Compare commits
3 commits
f0828b8d53
...
ce774e0f09
Author | SHA1 | Date | |
---|---|---|---|
|
ce774e0f09 | ||
|
10644a554d | ||
|
e07497f024 |
8 changed files with 8 additions and 273 deletions
|
@ -1,25 +0,0 @@
|
|||
const Command = require('../../src/structures/Command');
|
||||
module.exports = class Blacklist extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: 'blacklist',
|
||||
description: 'Master the Blacklist',
|
||||
aliases: ['bl'],
|
||||
module: 'Developers',
|
||||
cooldown: 0,
|
||||
guildOnly: false,
|
||||
developerOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
console.log(ctx.args)
|
||||
let ACTION = ctx.args[0]
|
||||
let ID = ctx.args[1]
|
||||
let REASON = ctx.args.shift().shift().join(' ')
|
||||
// let REASON = ctx.args[2]
|
||||
|
||||
let X = await ctx.utils.db.blacklist(ID, ACTION, REASON)
|
||||
console.log(X)
|
||||
}
|
||||
};
|
|
@ -1,45 +0,0 @@
|
|||
const Command = require("../../src/structures/Command");
|
||||
const exec = require("shell-exec");
|
||||
const dig = require("node-dig-dns");
|
||||
const {
|
||||
MessageEmbed
|
||||
} = require("discord.js");
|
||||
let DomainReg = new RegExp(
|
||||
`(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]`
|
||||
);
|
||||
module.exports = class Dig extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: "dig",
|
||||
description: "dig website dns information stuff",
|
||||
aliases: [],
|
||||
module: "Developers",
|
||||
cooldown: 10,
|
||||
guildOnly: false,
|
||||
developerOnly: true,
|
||||
nsfw: false
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
let count = 0;
|
||||
let domain = ctx.args[0];
|
||||
let type = ctx.args[1];
|
||||
const DIG = new MessageEmbed().setTitle(`${domain} (${type})`);
|
||||
if (domain.match(DomainReg)) {
|
||||
try {
|
||||
let result = await dig([domain, type]);
|
||||
|
||||
result.answer.forEach(r => {
|
||||
count++;
|
||||
DIG.addField(`Answer ${count}`, r.value);
|
||||
});
|
||||
} catch (error) {
|
||||
DIG.setDescription(
|
||||
`Either the Domain you are trying to dig for doesn't exist or the record you are requesting does not exist.`
|
||||
);
|
||||
}
|
||||
}
|
||||
ctx.send(DIG);
|
||||
}
|
||||
};
|
|
@ -1,80 +0,0 @@
|
|||
const Command = require('../../src/structures/Command');
|
||||
const { table } = require('quick.db');
|
||||
const Servers = new table('servers');
|
||||
const Users = new table('users');
|
||||
const Bot = new table('bot');
|
||||
|
||||
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, false, await ctx.db.backend.get('eval'));
|
||||
|
||||
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('🗑');
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
const Command = require('../../src/structures/Command');
|
||||
const exec = require('shell-exec');
|
||||
module.exports = class Exec extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: 'exec',
|
||||
description: 'Execute shell commands',
|
||||
aliases: [ 'ex' ],
|
||||
module: 'Developers',
|
||||
cooldown: 1,
|
||||
guildOnly: false,
|
||||
developerOnly: true,
|
||||
nsfw: false
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
const trying = await ctx.send('Attempting to execute ' + ctx.utils.format.bold(ctx.args.join(' ')));
|
||||
|
||||
await exec(ctx.args.join(' '))
|
||||
.then((r) => {
|
||||
trying.edit('```bash\n' + r.stdout + '```');
|
||||
})
|
||||
.catch((error) => {
|
||||
trying.edit('Failed to execute ' + ctx.utils.format.bold(ctx.args.join(' ')));
|
||||
});
|
||||
}
|
||||
};
|
|
@ -1,38 +0,0 @@
|
|||
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);
|
||||
|
||||
return ctx.send(`Reloaded \`${Command.name}\` in ${(Date.now() - date) / 1000}s.`);
|
||||
} catch (err) {
|
||||
return ctx.send(`Failed to reload the command.\n\`${err}\``);
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,19 +0,0 @@
|
|||
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) {
|
||||
await ctx.send('Restarting.');
|
||||
process.exit();
|
||||
}
|
||||
};
|
|
@ -1,34 +0,0 @@
|
|||
const Command = require('../../src/structures/Command');
|
||||
const exec = require('shell-exec');
|
||||
module.exports = class Update extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: 'update',
|
||||
description: 'Execute shell commands',
|
||||
aliases: [ 'up', 'pull' ],
|
||||
module: 'Developers',
|
||||
cooldown: 1,
|
||||
guildOnly: false,
|
||||
developerOnly: true,
|
||||
nsfw: false
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
const trying = await ctx.send(
|
||||
`${ctx.utils.emotes.random.loading} Getting the latest updates from ${ctx.config.source.replace(
|
||||
'https://',
|
||||
''
|
||||
)} ${ctx.utils.emotes.random.loading}`
|
||||
);
|
||||
|
||||
await exec('git pull')
|
||||
.then((r) => {
|
||||
trying.edit('```fix\n' + r.stdout + '```');
|
||||
})
|
||||
.catch((error) => {
|
||||
trying.edit(`Failed to get the latest updates.`);
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
};
|
12
index.js
12
index.js
|
@ -1,12 +1,16 @@
|
|||
const Client = require('./src/index');
|
||||
const config = require('./config');
|
||||
const { log } = require('./utils/index');
|
||||
const {
|
||||
log
|
||||
} = require('./utils/index');
|
||||
const yiff = require('yiff');
|
||||
|
||||
yiff.sheri.setToken(config.api.sheri);
|
||||
const { util } = require('discord.js');
|
||||
const {
|
||||
util
|
||||
} = require('discord.js');
|
||||
|
||||
util.fetchRecommendedShards(config.token).then(async (count) => {
|
||||
await log.starting();
|
||||
|
||||
new Client(config, count);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue