|
|
@@ -29,10 +29,10 @@ const listen = async (channelIDMap: Map<string, string>) => { |
|
|
|
const mainTextChannel = mainChannel as TextChannel; |
|
|
|
const pinTextChannel = pinChannel as TextChannel; |
|
|
|
|
|
|
|
const clientUser = client.user; |
|
|
|
if (!clientUser) { |
|
|
|
if (!client.user) { |
|
|
|
return; |
|
|
|
} |
|
|
|
const clientUser = client.user; |
|
|
|
|
|
|
|
if (message.type === 'CHANNEL_PINNED_MESSAGE') { |
|
|
|
const reply = await message.fetchReference(); |
|
|
@@ -47,11 +47,6 @@ const listen = async (channelIDMap: Map<string, string>) => { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
const mentioned = message.mentions.users.has(clientUser.id); |
|
|
|
if (!mentioned) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
switch (message.content) { |
|
|
|
case getCommandPattern(clientUser, 'pin'): |
|
|
|
await pin(message, mainTextChannel, pinTextChannel); |
|
|
@@ -63,7 +58,12 @@ const listen = async (channelIDMap: Map<string, string>) => { |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
await message.reply(messages.UNKNOWN_COMMAND); |
|
|
|
if ( |
|
|
|
message.content.startsWith(`<@!${clientUser.id}>`) |
|
|
|
|| message.content.startsWith(`<@${clientUser.id}>`) |
|
|
|
) { |
|
|
|
await message.reply(messages.UNKNOWN_COMMAND); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|