Added reply with images as attachement

This commit is contained in:
Loic Bersier 2018-09-21 19:12:11 +02:00
parent 69ee6c644e
commit 466151b8d7
3 changed files with 9 additions and 3 deletions

View file

@ -4,6 +4,7 @@ const { token, prefix, botID, statsChannel, ownerID, supportServer } = require('
const responseObject = require("./json/reply.json"); const responseObject = require("./json/reply.json");
const delresponseObject = require("./json/delreply.json"); const delresponseObject = require("./json/delreply.json");
const reactObject = require("./json/react.json"); const reactObject = require("./json/react.json");
const imgResponseObject = require("./json/imgreply.json");
// Prefix and ownerID and invite to support server // Prefix and ownerID and invite to support server
const client = new CommandoClient({ const client = new CommandoClient({
@ -74,8 +75,11 @@ client.registry
// } else // } else
// React to the message and send an auto response with it // React to the message and send an auto response with it
if (message.author.bot) return; { if (message.author.bot) return; {
// Reply with images as attachement
if(responseObject[message_content] && reactObject[message_content]) { 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.channel.send(responseObject[message_content]);
message.react(reactObject[message_content]); message.react(reactObject[message_content]);
// React only to the messages // React only to the messages

3
json/imgreply.json Normal file
View file

@ -0,0 +1,3 @@
{
"nibba": "https://pbs.twimg.com/media/Dnh887DXcAECKx6.jpg"
}

View file

@ -1,7 +1,6 @@
{ {
"haha yes": "haha very yes", "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", "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", "lol": "veri fun",
"my nama jeff": "my namaaaaa jeeeeeeeeeffff", "my nama jeff": "my namaaaaa jeeeeeeeeeffff",
"des": "PA\nCITO", "des": "PA\nCITO",