commit
9b818e7b00
1 changed files with 15 additions and 7 deletions
|
@ -18,11 +18,19 @@ export default async (message: Message) => {
|
||||||
`No counter found for guild: ${guild?.name} (${guild?.id})`
|
`No counter found for guild: ${guild?.name} (${guild?.id})`
|
||||||
);
|
);
|
||||||
const { word } = counter;
|
const { word } = counter;
|
||||||
if (content === word) {
|
|
||||||
channel?.send(`${author} said **${word}**.`);
|
const messages = await message.channel.messages.fetch({ limit: 1 });
|
||||||
logger?.verbose(`${author} said ${word} in ${channel}`);
|
const lastMessage = messages.last();
|
||||||
return logger?.verbose(
|
|
||||||
`User: ${author?.tag} (${author?.id}) in guild: ${guild?.name} (${guild?.id}) said the counter word: ${word}`
|
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}`
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue