Merge pull request #239 from VermiumSifell/dev

2022.4.5
This commit is contained in:
Axel Olausson Holtenäs 2022-04-17 22:56:20 +02:00 committed by GitHub
commit 9b818e7b00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,11 +18,19 @@ export default async (message: Message) => {
`No counter found for guild: ${guild?.name} (${guild?.id})`
);
const { word } = counter;
if (content === word) {
channel?.send(`${author} said **${word}**.`);
logger?.verbose(`${author} said ${word} in ${channel}`);
return logger?.verbose(
`User: ${author?.tag} (${author?.id}) in guild: ${guild?.name} (${guild?.id}) said the counter word: ${word}`
);
}
const messages = await message.channel.messages.fetch({ limit: 1 });
const lastMessage = messages.last();
if (!lastMessage) return;
if (content !== word) return;
if (lastMessage.author.id === message.author.id) return;
channel?.send(`${author} said **${word}**.`);
logger?.verbose(`${author} said ${word} in ${channel}`);
return logger?.verbose(
`User: ${author?.tag} (${author?.id}) in guild: ${guild?.name} (${guild?.id}) said the counter word: ${word}`
);
};