Merge pull request #236 from VermiumSifell/dev

2022.4.2
This commit is contained in:
Axel Olausson Holtenäs 2022-04-17 21:00:31 +02:00 committed by GitHub
commit e5b43b27a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;