3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix rare automod crash when the member for a message can't be found

This edge case should only occur when the member is banned or otherwise
leaves the server before automod processes the message.
This commit is contained in:
Dragory 2020-04-16 00:03:07 +03:00
parent 3c3327d9f0
commit 96f44b873e
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -596,6 +596,7 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
): Promise<Partial<TextTriggerMatchResult<T>>> {
const messageInfo: MessageInfo = { channelId: msg.channel_id, messageId: msg.id, userId: msg.user_id };
const member = await this.getMember(msg.user_id);
if (!member) return;
if (trigger.match_messages && msg.data.content) {
const str = msg.data.content;