From 29431bb08e29a2749b75afb679650bcdf5af6fff Mon Sep 17 00:00:00 2001 From: joshua Date: Thu, 23 Sep 2021 19:55:31 +0200 Subject: [PATCH] Post to DEL --- src/commands/utility/post.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/commands/utility/post.js diff --git a/src/commands/utility/post.js b/src/commands/utility/post.js new file mode 100644 index 0000000..6c86857 --- /dev/null +++ b/src/commands/utility/post.js @@ -0,0 +1,29 @@ +const util = require('../../util'); +const config = require('../../../config.json') +const Discord = require("discord.js"); +const DEL = require('@zerotwobot/del.js') // importing del +const del = new DEL(config.DELtoken, "889197952994791434") // initializing it + +module.exports = { + name: 'post', + + description: 'Post to DEL', + + + async execute(message, args, client) { + + if (!client.application.owner) + await client.application.fetch() + + if (client.application.owner.id !== message.author.id) { + return message.reply('This command is restricted to my developers.') + } + + try { + del.post(client.guilds.cache.size, 0) + return message.reply(`Successfully posted ${client.guilds.cache.size} guilds to DEL.`) + } catch (e) { + return message.reply(`Failed to post:\n\`${e}\``) + } + }, +}; \ No newline at end of file