Improve .gif replies, testing only
This commit is contained in:
parent
bb7c66d8db
commit
b81da266e1
@ -1,4 +1,7 @@
|
|||||||
## v3.4.x
|
## v3.4.x
|
||||||
|
#### v3.4.3 (#29)
|
||||||
|
* [WIP] Fix `.gif` replies to redirect to the original replyee
|
||||||
|
|
||||||
#### v3.4.2 (#28)
|
#### v3.4.2 (#28)
|
||||||
* Added `.drink` and aliases
|
* Added `.drink` and aliases
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,21 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
commandData.embed_url = res.data.results[0].url;
|
commandData.embed_url = res.data.results[0].url;
|
||||||
message.reply(commandData.embed_url);
|
|
||||||
|
// Handle when the invoking message is a reply to someone else
|
||||||
|
if (message.reference) {
|
||||||
|
// Fetch the referenced message from the channels' MessageManager
|
||||||
|
await message.channel.messages.fetch(message.reference.messageId).then((refMsg) => {
|
||||||
|
// Send the reply to the referenced message
|
||||||
|
await refMsg.reply(commandData.embed_url);
|
||||||
|
}).catch((e) => {
|
||||||
|
// Failed fetching the message from the channel, fallback to regular send
|
||||||
|
console.error(e);
|
||||||
|
await message.reply(commandData.embed_url);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await message.reply(commandData.embed_url);
|
||||||
|
}
|
||||||
}).catch(err => console.error(err));
|
}).catch(err => console.error(err));
|
||||||
// tenor.Search.Query(commandData.args, "1").then(res => {
|
// tenor.Search.Query(commandData.args, "1").then(res => {
|
||||||
// if (res[0] == undefined) {
|
// if (res[0] == undefined) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nodbot",
|
"name": "nodbot",
|
||||||
"version": "3.4.2",
|
"version": "3.4.3",
|
||||||
"description": "Nods and Nod Accessories",
|
"description": "Nods and Nod Accessories",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user