fix: only send expanded message link if present
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
450b28fbdf
commit
30b5293477
1 changed files with 18 additions and 16 deletions
|
@ -83,22 +83,24 @@ export async function expandDiscordLink(message: Message): Promise<void> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const reply = await message.reply({
|
if (resultEmbeds) {
|
||||||
embeds: resultEmbeds,
|
const reply = await message.reply({
|
||||||
allowedMentions: { repliedUser: false },
|
embeds: resultEmbeds,
|
||||||
});
|
allowedMentions: { repliedUser: false },
|
||||||
|
});
|
||||||
|
|
||||||
const collector = new ReactionCollector(reply, {
|
const collector = new ReactionCollector(reply, {
|
||||||
filter: (reaction) => {
|
filter: (reaction) => {
|
||||||
return reaction.emoji.name === '❌';
|
return reaction.emoji.name === '❌';
|
||||||
},
|
},
|
||||||
time: 5 * 60 * 1000,
|
time: 5 * 60 * 1000,
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on('collect', async (_, user) => {
|
collector.on('collect', async (_, user) => {
|
||||||
if (user === message.author) {
|
if (user === message.author) {
|
||||||
await reply.delete();
|
await reply.delete();
|
||||||
collector.stop();
|
collector.stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue