Fix crash when trying to match words to a custom status with only an emoji
This commit is contained in:
parent
7a5b11597b
commit
d125176907
1 changed files with 2 additions and 2 deletions
|
@ -560,7 +560,7 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
|
||||||
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 = this.guild.members.get(msg.user_id);
|
const member = this.guild.members.get(msg.user_id);
|
||||||
|
|
||||||
if (msg.data.content && trigger.match_messages) {
|
if (trigger.match_messages && msg.data.content) {
|
||||||
const str = msg.data.content;
|
const str = msg.data.content;
|
||||||
const matchResult = await matchFn(str);
|
const matchResult = await matchFn(str);
|
||||||
if (matchResult) {
|
if (matchResult) {
|
||||||
|
@ -601,7 +601,7 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
|
||||||
}
|
}
|
||||||
|
|
||||||
// type 4 = custom status
|
// type 4 = custom status
|
||||||
if (trigger.match_custom_status && member.game && member.game.type === 4) {
|
if (trigger.match_custom_status && member.game && member.game.type === 4 && member.game.state) {
|
||||||
const str = member.game.state;
|
const str = member.game.state;
|
||||||
const matchResult = await matchFn(str);
|
const matchResult = await matchFn(str);
|
||||||
if (matchResult) {
|
if (matchResult) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue