diff --git a/rowboat/models/user.py b/rowboat/models/user.py index b1d8edb10..e79ff298a 100644 --- a/rowboat/models/user.py +++ b/rowboat/models/user.py @@ -159,8 +159,8 @@ def serialize(self, guild=None, user=None, actor=None, include_metadata=False): return base @staticmethod - def admin_config(event): - return getattr(event.base_config.plugins, 'admin', None) + def infractions_config(event): + return getattr(event.base_config.plugins, 'infractions', None) @classmethod def temprole(cls, plugin, event, member, role_id, reason, expires_at): @@ -335,17 +335,17 @@ def warn(cls, plugin, event, member, reason, guild): @classmethod def mute(cls, plugin, event, member, reason): from rowboat.plugins.modlog import Actions - admin_config = cls.admin_config(event) + infractions_config = cls.infractions_config(event) plugin.call( 'ModLogPlugin.create_debounce', event, ['GuildMemberUpdate'], user_id=member.user.id, - role_id=admin_config.mute_role, + role_id=infractions_config.mute_role, ) - member.add_role(admin_config.mute_role, reason=reason) + member.add_role(infractions_config.mute_role, reason=reason) plugin.call( 'ModLogPlugin.log_action_ext', @@ -362,14 +362,14 @@ def mute(cls, plugin, event, member, reason): actor_id=event.author.id, type_=cls.Types.MUTE, reason=reason, - metadata={'role': admin_config.mute_role}) + metadata={'role': infractions_config.mute_role}) @classmethod def tempmute(cls, plugin, event, member, reason, expires_at): from rowboat.plugins.modlog import Actions - admin_config = cls.admin_config(event) + infractions_config = cls.infractions_config(event) - if not admin_config.mute_role: + if not infractions_config.mute_role: plugin.log.warning('Cannot tempmute member %s, no tempmute role', member.id) return @@ -378,10 +378,10 @@ def tempmute(cls, plugin, event, member, reason, expires_at): event, ['GuildMemberUpdate'], user_id=member.user.id, - role_id=admin_config.mute_role, + role_id=infractions_config.mute_role, ) - member.add_role(admin_config.mute_role, reason=reason) + member.add_role(infractions_config.mute_role, reason=reason) plugin.call( 'ModLogPlugin.log_action_ext', @@ -400,7 +400,7 @@ def tempmute(cls, plugin, event, member, reason, expires_at): type_=cls.Types.TEMPMUTE, reason=reason, expires_at=expires_at, - metadata={'role': admin_config.mute_role}) + metadata={'role': infractions_config.mute_role}) @classmethod def clear_active(cls, event, user_id, types):