From 25af0382c7e0682a214cbaa34aeb1372378aa458 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 29 Oct 2020 00:29:35 +1100 Subject: [PATCH] ping --- bot/commands/Bot/ping.js | 24 ++++++++++++++++++++++++ bot/constants/index.js | 3 ++- bot/constants/responses.json | 11 +++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 bot/commands/Bot/ping.js create mode 100644 bot/constants/responses.json diff --git a/bot/commands/Bot/ping.js b/bot/commands/Bot/ping.js new file mode 100644 index 0000000..c792229 --- /dev/null +++ b/bot/commands/Bot/ping.js @@ -0,0 +1,24 @@ +module.exports = class { + constructor (name, category) { + this.name = name, + this.category = category, + this.enabled = true, + this.devOnly = false, + this.aliases = [], + this.userPerms = [], + this.botPerms = [], + this.cooldown = 2000, + this.help = { + description: 'Test response time between Woomy and Discord.', + usage: 'ping', + examples: null + }; + } + + run (client, message, args, data) { //eslint-disable-line no-unused-vars + message.channel.createMessage(client.constants.responses.ping.random()) + .then(m => { + m.edit(`${m.content} \`roundtrip: ${m.timestamp - message.timestamp}ms | websocket: ${message.channel.guild.shard.latency}ms\``); + }); + } +}; \ No newline at end of file diff --git a/bot/constants/index.js b/bot/constants/index.js index dd0f0bd..8c99a37 100644 --- a/bot/constants/index.js +++ b/bot/constants/index.js @@ -2,5 +2,6 @@ module.exports = { activities: require('./activities.json'), colours: require('./colours.json'), emojis: require('./emojis.json'), - categories: require('./categories.json') + categories: require('./categories.json'), + responses: require ('./responses.json') }; \ No newline at end of file diff --git a/bot/constants/responses.json b/bot/constants/responses.json new file mode 100644 index 0000000..2d049e5 --- /dev/null +++ b/bot/constants/responses.json @@ -0,0 +1,11 @@ +{ + "ping": [ + "Heya!", + "Pong!", + "Did you need something?", + "Hello?", + "Hi there!", + "You called?", + "Huh?" + ] +} \ No newline at end of file