Remove shutdown and webhook (webhook is moving to Fidget)

This commit is contained in:
Daniel Odendahl Jr
2017-09-29 00:57:19 +00:00
parent 38a1e11b02
commit 571498e354
2 changed files with 0 additions and 73 deletions
-40
View File
@@ -1,40 +0,0 @@
const { Command } = require('discord.js-commando');
const snekfetch = require('snekfetch');
const { WEBHOOK_URL } = process.env;
module.exports = class WebhookCommand extends Command {
constructor(client) {
super(client, {
name: 'webhook',
aliases: ['rin', 'rin-say'],
group: 'text-edit',
memberName: 'webhook',
description: 'Posts a message to the webhook defined in your `process.env`.',
args: [
{
key: 'content',
prompt: 'What text would you like the webhook to say?',
type: 'string'
}
]
});
}
hasPermission(msg) {
return this.client.isOwner(msg.author) || `The \`${this.name}\` command can only be used by the bot owner.`;
}
async run(msg, { content }) {
if (msg.channel.type === 'text' && msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) {
await msg.delete();
}
try {
await snekfetch
.post(WEBHOOK_URL)
.send({ content });
return null;
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
-33
View File
@@ -1,33 +0,0 @@
const { Command } = require('discord.js-commando');
module.exports = class ShutdownCommand extends Command {
constructor(client) {
super(client, {
name: 'shutdown',
aliases: ['restart', 'power-off', 'die'],
group: 'util',
memberName: 'shutdown',
description: 'Shuts down the current shard, or all shards.',
guarded: true,
args: [
{
key: 'all',
prompt: 'Would you like to shutdown all shards?',
type: 'boolean',
default: false
}
]
});
}
hasPermission(msg) {
return this.client.isOwner(msg.author) || `The \`${this.name}\` command can only be used by the bot owner.`;
}
async run(msg, { all }) {
await msg.say(`Shutting down ${all ? 'all shards' : 'this shard'}...`);
if (all) await this.client.shard.broadcastEval('process.exit(0)');
else process.exit(0);
return null;
}
};