From d764f932f221fdc59f0eb679a064bab50ad8f96f Mon Sep 17 00:00:00 2001 From: Patrick Hanford Date: Sat, 29 Sep 2018 12:10:36 -0400 Subject: [PATCH] Added command !code to send a message to the channel with this repository --- config.json | 2 +- index.js | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index e1f27c7..be4190d 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "token" : "Add Your Key", + "token" : "YourKey", "prefix" : "!" } \ No newline at end of file diff --git a/index.js b/index.js index 23a781e..2f51a78 100644 --- a/index.js +++ b/index.js @@ -47,7 +47,26 @@ setInterval(function() { .catch(console.error); }, 30000) -}) +}); + +bot.on('message', async message => { + if(message.author.bot) return; + + let prefix = config.prefix; + let messageBody = message.content.split(" "); + let command = messageBody[0]; + + + if(command == `${prefix}code`){ + let repo = new Discord.RichEmbed() + .setDescription("Stats Bot Repository") + .setColor("#00FF00") + .addField("Github", "https://github.com/CodeSpent/discord-stats"); + + + return message.channel.send(repo); + } +});