From 466151b8d75356d0843b325eebd9a39df641cb30 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Fri, 21 Sep 2018 19:12:11 +0200 Subject: [PATCH] Added reply with images as attachement --- index.js | 8 ++++++-- json/imgreply.json | 3 +++ json/reply.json | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 json/imgreply.json diff --git a/index.js b/index.js index 59d5fc8..27a033c 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ const { token, prefix, botID, statsChannel, ownerID, supportServer } = require(' const responseObject = require("./json/reply.json"); const delresponseObject = require("./json/delreply.json"); const reactObject = require("./json/react.json"); +const imgResponseObject = require("./json/imgreply.json"); // Prefix and ownerID and invite to support server const client = new CommandoClient({ @@ -74,8 +75,11 @@ client.registry // } else // React to the message and send an auto response with it if (message.author.bot) return; { - - if(responseObject[message_content] && reactObject[message_content]) { +// Reply with images as attachement + if(imgResponseObject[message_content]) { + message.channel.send({files: [imgResponseObject[message_content]]}); + } + else if(responseObject[message_content] && reactObject[message_content]) { message.channel.send(responseObject[message_content]); message.react(reactObject[message_content]); // React only to the messages diff --git a/json/imgreply.json b/json/imgreply.json new file mode 100644 index 0000000..01d1139 --- /dev/null +++ b/json/imgreply.json @@ -0,0 +1,3 @@ +{ + "nibba": "https://pbs.twimg.com/media/Dnh887DXcAECKx6.jpg" +} \ No newline at end of file diff --git a/json/reply.json b/json/reply.json index a9d87fa..acb71f8 100644 --- a/json/reply.json +++ b/json/reply.json @@ -1,7 +1,6 @@ { "haha yes": "haha very yes", "nigger": "nigger LOL get it xD I said nigger HAHHAHAHAHAHA get it cuz its not socially acceptable to say nigger so its funny ROFL saaaayyy NIGGER LMFAOOOO", - "nibba": "https://pbs.twimg.com/media/Dnh887DXcAECKx6.jpg", "lol": "veri fun", "my nama jeff": "my namaaaaa jeeeeeeeeeffff", "des": "PA\nCITO",