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:
parent
3c3327d9f0
commit
96f44b873e
1 changed files with 1 additions and 0 deletions
|
@ -596,6 +596,7 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
|
||||||
): Promise<Partial<TextTriggerMatchResult<T>>> {
|
): Promise<Partial<TextTriggerMatchResult<T>>> {
|
||||||
const messageInfo: MessageInfo = { channelId: msg.channel_id, messageId: msg.id, userId: msg.user_id };
|
const messageInfo: MessageInfo = { channelId: msg.channel_id, messageId: msg.id, userId: msg.user_id };
|
||||||
const member = await this.getMember(msg.user_id);
|
const member = await this.getMember(msg.user_id);
|
||||||
|
if (!member) return;
|
||||||
|
|
||||||
if (trigger.match_messages && msg.data.content) {
|
if (trigger.match_messages && msg.data.content) {
|
||||||
const str = msg.data.content;
|
const str = msg.data.content;
|
||||||
|
|
Loading…
Add table
Reference in a new issue