commit
e5b43b27a4
1 changed files with 11 additions and 0 deletions
|
@ -11,6 +11,17 @@ export default {
|
|||
if (author.bot) return;
|
||||
if (channel?.type !== "GUILD_TEXT") return;
|
||||
|
||||
const messages = await message.channel.messages.fetch({ limit: 2 });
|
||||
const lastMessage = messages.last();
|
||||
|
||||
if (lastMessage?.author.id === author.id) {
|
||||
logger.verbose(
|
||||
`${author.username} sent the last message therefor not allowing again.`
|
||||
);
|
||||
await message.delete();
|
||||
return;
|
||||
}
|
||||
|
||||
const { id: guildId } = guild;
|
||||
const { id: channelId } = channel;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue