From d724bc374bfec0bbb44ad1149fee2d61c4416abc Mon Sep 17 00:00:00 2001 From: ION606 Date: Thu, 17 Feb 2022 23:37:48 -0500 Subject: [PATCH] Added arrow, very glitchy though --- commands/arrow.js | 25 +++++++++++++++++++++++++ main.js | 6 ++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 commands/arrow.js diff --git a/commands/arrow.js b/commands/arrow.js new file mode 100644 index 0000000..6254bdc --- /dev/null +++ b/commands/arrow.js @@ -0,0 +1,25 @@ +module.exports = { + name: 'arrow', + description: 'Engage in a trademarked activity and throw an arrow at a trash can', + async execute(message, args) { + let counter = 0; + arrow = '>'; + while (true) { + arrow = '-' + arrow; + message.channel.send(arrow); + await message.channel.messages.fetch({limit: 1}).then(messages => { + message.channel.bulkDelete(messages); + }); + counter ++; + if (counter >= 5) { + message.channel.messages.fetch({limit: 1}).then(messages => { + message.channel.bulkDelete(messages); + }); + arrow = arrow + '🗑️'; + message.channel.send(arrow); + break; + } + } + + } +} \ No newline at end of file diff --git a/main.js b/main.js index 5e04da6..d91f214 100644 --- a/main.js +++ b/main.js @@ -47,8 +47,7 @@ client.on('messageCreate', (message) => { const args = message.content.slice(prefix.length).split(' '); const command = args.shift().toLowerCase(); - - //test message (can also use message.channel.send('thing') instead of message.reply('thing)) + //Check if the user has sufficient permission //Performes the command @@ -62,6 +61,9 @@ client.on('messageCreate', (message) => { case 'links': client.commands.get('links').execute(message, args, Discord); break; + case 'arrow': client.commands.get('arrow').execute(message, args, Discord); + break; + default: message.channel.send("'" + message.content + "' is not a command!"); } })