Skip to content

Commit

Permalink
Fix automod execution errors from rules without an associated channel (
Browse files Browse the repository at this point in the history
  • Loading branch information
CheesyGamer77 committed Jun 20, 2023
1 parent 3ebfac1 commit 0a501e2
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -39,7 +39,7 @@ public class AutoModExecutionImpl implements AutoModExecution
public AutoModExecutionImpl(Guild guild, DataObject json)
{
this.guild = guild;
this.channel = guild.getChannelById(GuildMessageChannel.class, json.getUnsignedLong("channel_id"));
this.channel = guild.getChannelById(GuildMessageChannel.class, json.getUnsignedLong("channel_id", 0L));
this.response = new AutoModResponseImpl(guild, json.getObject("action"));
this.type = AutoModTriggerType.fromKey(json.getInt("rule_trigger_type", -1));
this.userId = json.getUnsignedLong("user_id");
Expand Down

0 comments on commit 0a501e2

Please sign in to comment.