From 77564478ad8c38f81b26fe22c1a62b40260a387a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sun, 9 Sep 2018 21:32:08 +0200 Subject: [PATCH] async --- commands/admin/assignrank.js | 2 +- commands/admin/ban.js | 2 +- commands/admin/kick.js | 2 +- commands/admin/prune.js | 2 +- commands/fun/badmeme.js | 2 +- commands/fun/despacito.js | 2 +- commands/fun/funfact.js | 2 +- commands/fun/music.js | 2 +- commands/fun/yes.js | 2 +- commands/owner/botAvatar.js | 3 ++- commands/owner/ded.js | 2 +- commands/owner/selftest.js | 15 +++++++++++++++ commands/owner/status.js | 3 ++- commands/owner/username.js | 3 ++- commands/thing/avatar.js | 2 +- commands/thing/invite.js | 2 +- commands/thing/stats.js | 2 +- commands/thing/updoot.js | 2 +- index.js | 2 +- 19 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 commands/owner/selftest.js diff --git a/commands/admin/assignrank.js b/commands/admin/assignrank.js index c0b45692..4484896e 100644 --- a/commands/admin/assignrank.js +++ b/commands/admin/assignrank.js @@ -24,7 +24,7 @@ module.exports = class AssignRankCommand extends Command { }); } - run(message, { rank, member }) { + async run(message, { rank, member }) { const role = message.guild.roles.find('name', rank); member = message.mentions.members.first(); if (!role) { diff --git a/commands/admin/ban.js b/commands/admin/ban.js index ad1ae506..fa3c7c10 100644 --- a/commands/admin/ban.js +++ b/commands/admin/ban.js @@ -19,7 +19,7 @@ module.exports = class BanCommand extends Command { }); } - run(message) { + async run(message) { const member = message.mentions.members.first(); member.ban(reason.join(" ")).then(member => { message.reply(`${member.user.username} was succesfully banned.`); diff --git a/commands/admin/kick.js b/commands/admin/kick.js index e92f74dc..3e329482 100644 --- a/commands/admin/kick.js +++ b/commands/admin/kick.js @@ -19,7 +19,7 @@ module.exports = class KickCommand extends Command { }); } - run(message) { + async run(message) { const member = message.mentions.members.first(); member.kick(reason.join(" ")).then(member => { message.reply(`${member.user.username} was succesfully kicked.`); diff --git a/commands/admin/prune.js b/commands/admin/prune.js index 973fb070..9f615246 100644 --- a/commands/admin/prune.js +++ b/commands/admin/prune.js @@ -19,7 +19,7 @@ module.exports = class PruneCommand extends Command { }); } - run(message, { amount }) { + async run(message, { amount }) { if (amount < 2 || amount > 100) { return message.reply('you need to input a number between 2 and 100.'); } diff --git a/commands/fun/badmeme.js b/commands/fun/badmeme.js index 3b90a0e9..e69e0460 100644 --- a/commands/fun/badmeme.js +++ b/commands/fun/badmeme.js @@ -10,7 +10,7 @@ module.exports = class BadmemeCommand extends Command { }); } - run(message) { + async run(message) { const number = Object.keys(responseObject).length; const picNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1; message.channel.send(`${picNumber}: ${responseObject[picNumber]}`); diff --git a/commands/fun/despacito.js b/commands/fun/despacito.js index 9d837a36..7514ecdc 100644 --- a/commands/fun/despacito.js +++ b/commands/fun/despacito.js @@ -10,7 +10,7 @@ module.exports = class DespacitoCommand extends Command { }); } - run(message) { + async run(message) { const number = Object.keys(responseObject).length; const vidNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1; message.channel.send(`${vidNumber}: ${responseObject[vidNumber]}`); diff --git a/commands/fun/funfact.js b/commands/fun/funfact.js index d89b3d25..26908a4a 100644 --- a/commands/fun/funfact.js +++ b/commands/fun/funfact.js @@ -10,7 +10,7 @@ module.exports = class FunFactCommand extends Command { }); } - run(message) { + async run(message) { const number = Object.keys(responseObject).length; const funFactNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1; message.channel.send(`Fun fact: ${responseObject[funFactNumber]}`); diff --git a/commands/fun/music.js b/commands/fun/music.js index e4f9ddd3..928d0f1e 100644 --- a/commands/fun/music.js +++ b/commands/fun/music.js @@ -17,7 +17,7 @@ module.exports = class MusicCommand extends Command { }); } - run(message, { ytblink }) { + async run(message, { ytblink }) { const { voiceChannel } = message.member; if (!voiceChannel) { diff --git a/commands/fun/yes.js b/commands/fun/yes.js index d463ddfd..3c0a5511 100644 --- a/commands/fun/yes.js +++ b/commands/fun/yes.js @@ -9,7 +9,7 @@ module.exports = class YesCommand extends Command { }); } - run(message) { + async run(message) { return message.say('haha very yes'); } }; \ No newline at end of file diff --git a/commands/owner/botAvatar.js b/commands/owner/botAvatar.js index f681236a..93ad052c 100644 --- a/commands/owner/botAvatar.js +++ b/commands/owner/botAvatar.js @@ -17,7 +17,8 @@ module.exports = class BotavatarCommand extends Command { }); } - run(message, { pic }) { + async run(message, { pic }) { this.client.user.setAvatar(pic); + message.say('The avatar have been changed succesfully'); } }; \ No newline at end of file diff --git a/commands/owner/ded.js b/commands/owner/ded.js index 0a134d66..f5afc284 100644 --- a/commands/owner/ded.js +++ b/commands/owner/ded.js @@ -12,6 +12,6 @@ module.exports = class DedCommand extends Command { } async run(message) { - await message.say("im dead now k bye thx); + await message.say('im dead now k bye thx'); process.exit(); }} \ No newline at end of file diff --git a/commands/owner/selftest.js b/commands/owner/selftest.js new file mode 100644 index 00000000..3c0a5511 --- /dev/null +++ b/commands/owner/selftest.js @@ -0,0 +1,15 @@ +const { Command } = require('discord.js-commando'); +module.exports = class YesCommand extends Command { + constructor(client) { + super(client, { + name: 'yes', + group: 'fun', + memberName: 'yes', + description: 'very yes', + }); + } + + async run(message) { + return message.say('haha very yes'); + } +}; \ No newline at end of file diff --git a/commands/owner/status.js b/commands/owner/status.js index d4b7ec24..e557eb85 100644 --- a/commands/owner/status.js +++ b/commands/owner/status.js @@ -17,7 +17,8 @@ module.exports = class StatusCommand extends Command { }); } - run(message, { status }) { + async run(message, { status }) { this.client.user.setActivity(status); + message.say(`Status have been set to ${status}`); } }; \ No newline at end of file diff --git a/commands/owner/username.js b/commands/owner/username.js index fe5f4707..cd7338f2 100644 --- a/commands/owner/username.js +++ b/commands/owner/username.js @@ -17,8 +17,9 @@ module.exports = class UsernameCommand extends Command { }); } - run(message, { username }) { + async run(message, { username }) { this.client.user.setUsername(username); + message.say(`The username have been changed sucessfully to ${username}`); } }; \ No newline at end of file diff --git a/commands/thing/avatar.js b/commands/thing/avatar.js index be5f6507..4f1ada16 100644 --- a/commands/thing/avatar.js +++ b/commands/thing/avatar.js @@ -9,7 +9,7 @@ module.exports = class AvatarCommand extends Command { }); } - run(message) { + async run(message) { if (!message.mentions.users.size) { return message.channel.send(`Your avatar: ${message.author.displayAvatarURL}`); } diff --git a/commands/thing/invite.js b/commands/thing/invite.js index 137ce17e..d4c3dead 100644 --- a/commands/thing/invite.js +++ b/commands/thing/invite.js @@ -9,7 +9,7 @@ module.exports = class InviteCommand extends Command { }); } - run(message) { + async run(message) { return message.say('You can add me from here: https://discordapp.com/oauth2/authorize?client_id=487342817048264704&scope=bot&permissions=2054\nYou can join my support server over here: https://discord.gg/SsMCsVY come and say hi :)'); } }; \ No newline at end of file diff --git a/commands/thing/stats.js b/commands/thing/stats.js index e8218a03..da1a5064 100644 --- a/commands/thing/stats.js +++ b/commands/thing/stats.js @@ -9,7 +9,7 @@ module.exports = class MeowCommand extends Command { }); } - run(message) { + async run(message) { return message.channel.send(`Servers: \`${this.client.guilds.size}\`\nChannels: \`${this.client.channels.size}\`\nUsers: \`${this.client.users.size}\`\nBot uptime: \`${process.uptime()}\``); } }; \ No newline at end of file diff --git a/commands/thing/updoot.js b/commands/thing/updoot.js index 53adc0ec..abc01120 100644 --- a/commands/thing/updoot.js +++ b/commands/thing/updoot.js @@ -10,7 +10,7 @@ module.exports = class UpDootCommand extends Command { }); } - run(message) { + async run(message) { const upDoot = { color: 0x93C54B, title: 'Vote for my bot', diff --git a/index.js b/index.js index 8ba15e12..2bc7ca7e 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ const fs = require("fs"); // Prefix and ownerID and invite to support server const client = new CommandoClient({ - commandPrefix: 'haha', + commandPrefix: 'h3h3', owner: '267065637183029248', invite: 'https://discord.gg/SsMCsVY', });