From 60f2ebbc2ad2668f819997cbc4f3f098808d55f6 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 28 Jun 2021 22:38:03 -0400 Subject: [PATCH] Adding requester in response --- config.json | 2 +- index.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config.json b/config.json index dc0cec2..4bcfb5d 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "prefix": "/", "serverID": "760701839427108874", - "logChannel": "858449941911437353", + "logChannel": "859249300894908447", "bootMessage": "NodBot v2 Starting Up", "shutdownMessage": "NodBot v2 Shutting Down" } \ No newline at end of file diff --git a/index.js b/index.js index 2075af9..2ccc98b 100644 --- a/index.js +++ b/index.js @@ -67,14 +67,14 @@ client.on('message', message => { if (!client.gifs.has(file[0])) { giphy.search(query, (err, res) => { if (res.data[0] != undefined) { - message.channel.send(res.data[0].embed_url).then().catch(console.error); + message.channel.send(query + ' requested by ' + message.author.username + '\n' + res.data[0].embed_url).then().catch(console.error); } else { message.channel.send('I was unable to find a gif of ' + query); } if (err) console.error(err); }); } else { - message.channel.send(client.gifs.get(query).embed_url); + message.channel.send(query + ' requested by ' + message.author.username + '\n' + client.gifs.get(query).embed_url); } break; case 'pasta': @@ -92,5 +92,8 @@ client.on('message', message => { } } - + // Try to delete the requester's message + if (message.deletable) { + message.delete().then().catch(err => console.error(err)); + } }); \ No newline at end of file