fuck node
This commit is contained in:
parent
9ad8081971
commit
304d0ccb96
49 changed files with 1305 additions and 403 deletions
90
DiscordModules/Developers/eval.js
Executable file
90
DiscordModules/Developers/eval.js
Executable file
|
@ -0,0 +1,90 @@
|
|||
const Command = require("../../src/structures/Command");
|
||||
const { table } = require("quick.db");
|
||||
const Servers = new table("servers");
|
||||
const Users = new table("users");
|
||||
|
||||
const clean = text => {
|
||||
if (typeof text == "string")
|
||||
return text
|
||||
.replace(/`/g, "`" + String.fromCharCode(8203))
|
||||
.replace(/@/g, "@" + String.fromCharCode(8203));
|
||||
else return text;
|
||||
};
|
||||
|
||||
module.exports = class Eval extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: "eval",
|
||||
description: "Run JavaScript code directly from the process.",
|
||||
aliases: ["ev", "e"],
|
||||
module: "Developers",
|
||||
cooldown: 0,
|
||||
guildOnly: false,
|
||||
developerOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
if (!ctx.args.length) return;
|
||||
|
||||
const client = ctx.client;
|
||||
|
||||
let code = ctx.args.join(" ");
|
||||
let silent = false;
|
||||
|
||||
if (code.endsWith("-s")) (code = code.split("-s")[0]), (silent = true);
|
||||
if (code.endsWith("--silent"))
|
||||
(code = code.split("--silent")[0]), (silent = true);
|
||||
|
||||
try {
|
||||
let evaled = await eval(code);
|
||||
|
||||
if (typeof evaled != "string") evaled = require("util").inspect(evaled);
|
||||
|
||||
evaled.replace(
|
||||
new RegExp(client.token.replace(/\./g, "\\.", "g")),
|
||||
"uwu"
|
||||
);
|
||||
|
||||
if (!silent) {
|
||||
ctx
|
||||
.send(`\`\`\`js\n${clean(evaled)}\n\`\`\``)
|
||||
.then(async m => {
|
||||
await m.react("📥");
|
||||
await m.react("🗑");
|
||||
})
|
||||
.catch(err => {
|
||||
ctx
|
||||
.send(
|
||||
`\`Content is over 2,000 characters: react to upload to Hastebin\``
|
||||
)
|
||||
.then(async m => {
|
||||
client.lastEval = clean(evaled);
|
||||
|
||||
await m.react("📥");
|
||||
await m.react("🗑");
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
ctx
|
||||
.send(`\`\`\`js\n${clean(error)}\n\`\`\``)
|
||||
.then(async m => {
|
||||
await m.react("📥");
|
||||
await m.react("🗑");
|
||||
})
|
||||
.catch(err => {
|
||||
ctx
|
||||
.send(
|
||||
`\`Content is over 2,000 characters: react to upload to Hastebin\``
|
||||
)
|
||||
.then(async m => {
|
||||
client.lastEval = clean(error);
|
||||
|
||||
await m.react("📥");
|
||||
await m.react("🗑");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
39
DiscordModules/Developers/reload.js
Executable file
39
DiscordModules/Developers/reload.js
Executable file
|
@ -0,0 +1,39 @@
|
|||
const Command = require('../../src/structures/Command');
|
||||
|
||||
module.exports = class Reload extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: 'reload',
|
||||
description: 'Reload a command without restarting the process.',
|
||||
aliases: ['re'],
|
||||
module: 'Developers',
|
||||
cooldown: 0,
|
||||
guildOnly: false,
|
||||
developerOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
if (!ctx.args.length) return;
|
||||
const date = Date.now();
|
||||
|
||||
const data = ctx.args[0];
|
||||
const [module,command] = data.split('/');
|
||||
|
||||
if (!module || !command) return;
|
||||
|
||||
try {
|
||||
delete require.cache[require.resolve(`../${module}/${command}`)];
|
||||
delete ctx.client.commands.get(command);
|
||||
|
||||
const cmd = require(`../${module}/${command}`);
|
||||
const Command = new cmd();
|
||||
ctx.client.commands.set(Command.name, Command);
|
||||
|
||||
console.log(`Reloaded \`${Command.name}\` in ${(Date.now() - date) / 1000}s.`)
|
||||
return ctx.send(`Reloaded \`${Command.name}\` in ${(Date.now() - date) / 1000}s.`);
|
||||
} catch(err) {
|
||||
return ctx.send(`Failed to reload the command.\n\`${err}\``);
|
||||
}
|
||||
}
|
||||
}
|
21
DiscordModules/Developers/setup.js
Executable file
21
DiscordModules/Developers/setup.js
Executable file
|
@ -0,0 +1,21 @@
|
|||
const Command = require("../../src/structures/Command");
|
||||
module.exports = class Setup extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: "setup",
|
||||
description: "x",
|
||||
aliases: ["s"],
|
||||
module: "Developers",
|
||||
cooldown: 0,
|
||||
guildOnly: false,
|
||||
developerOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
let x = await ctx.utils.db.prefix
|
||||
.remove(ctx)
|
||||
.catch(err => console.error(err));
|
||||
//' console.log(x);
|
||||
}
|
||||
};
|
18
DiscordModules/Developers/stop.js
Executable file
18
DiscordModules/Developers/stop.js
Executable file
|
@ -0,0 +1,18 @@
|
|||
const Command = require("../../src/structures/Command");
|
||||
module.exports = class Stop extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: "stop",
|
||||
description: "Stops the bot",
|
||||
aliases: [],
|
||||
module: "Developers",
|
||||
cooldown: 0,
|
||||
guildOnly: false,
|
||||
developerOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
process.exit();
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue