From 39e52f573bdcf8fb538fff5175f241c55bd9e0b3 Mon Sep 17 00:00:00 2001 From: Akarys42 Date: Mon, 21 Oct 2019 18:44:17 +0200 Subject: Create STAFF_CHANNELS constant --- bot/constants.py | 8 ++++++++ config-default.yml | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bot/constants.py b/bot/constants.py index 4beae84e9..f341fb499 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -328,6 +328,7 @@ class Channels(metaclass=YAMLGetter): subsection = "channels" admins: int + admin_spam: int announcements: int big_brother_logs: int bot: int @@ -346,11 +347,14 @@ class Channels(metaclass=YAMLGetter): helpers: int message_log: int meta: int + mod_spam: int + mods: int mod_alerts: int modlog: int off_topic_0: int off_topic_1: int off_topic_2: int + organisation: int python: int reddit: int talent_pool: int @@ -392,6 +396,7 @@ class Guild(metaclass=YAMLGetter): id: int ignored: List[int] + staff_channels: List[int] class Keys(metaclass=YAMLGetter): @@ -507,6 +512,9 @@ PROJECT_ROOT = os.path.abspath(os.path.join(BOT_DIR, os.pardir)) MODERATION_ROLES = Roles.moderator, Roles.admin, Roles.owner STAFF_ROLES = Roles.helpers, Roles.moderator, Roles.admin, Roles.owner +# Roles combinations +STAFF_CHANNELS = Guild.staff_channels + # Bot replies NEGATIVE_REPLIES = [ diff --git a/config-default.yml b/config-default.yml index 197743296..23dcbd44c 100644 --- a/config-default.yml +++ b/config-default.yml @@ -90,11 +90,12 @@ guild: channels: admins: &ADMINS 365960823622991872 + admin_spam: &ADMIN_SPAM 563594791770914816 announcements: 354619224620138496 big_brother_logs: &BBLOGS 468507907357409333 bot: 267659945086812160 checkpoint_test: 422077681434099723 - defcon: 464469101889454091 + defcon: &DEFCON 464469101889454091 devlog: &DEVLOG 622895325144940554 devtest: &DEVTEST 414574275865870337 help_0: 303906576991780866 @@ -105,14 +106,17 @@ guild: help_5: 454941769734422538 help_6: 587375753306570782 help_7: 587375768556797982 - helpers: 385474242440986624 + helpers: &HELPERS 385474242440986624 message_log: &MESSAGE_LOG 467752170159079424 meta: 429409067623251969 + mod_spam: &MOD_SPAM 620607373828030464 + mods: &MODS 305126844661760000 mod_alerts: 473092532147060736 modlog: &MODLOG 282638479504965634 off_topic_0: 291284109232308226 off_topic_1: 463035241142026251 off_topic_2: 463035268514185226 + organisation: &ORGANISATION 551789653284356126 python: 267624335836053506 reddit: 458224812528238616 staff_lounge: &STAFF_LOUNGE 464905259261755392 @@ -121,6 +125,7 @@ guild: user_event_a: &USER_EVENT_A 592000283102674944 verification: 352442727016693763 + staff_channels: [*ADMINS, *ADMIN_SPAM, *MOD_SPAM, *MODS, *HELPERS, *ORGANISATION, *DEFCON] ignored: [*ADMINS, *MESSAGE_LOG, *MODLOG] roles: -- cgit v1.2.3 From 2bff275f39347c0c1fb06be38b3119fe7f23e273 Mon Sep 17 00:00:00 2001 From: Akarys42 Date: Mon, 21 Oct 2019 18:45:25 +0200 Subject: Show total infraction count only in staff channels --- bot/cogs/moderation/infractions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py index f2ae7b95d..997ffe524 100644 --- a/bot/cogs/moderation/infractions.py +++ b/bot/cogs/moderation/infractions.py @@ -12,7 +12,7 @@ from discord.ext.commands import Context, command from bot import constants from bot.api import ResponseCodeError -from bot.constants import Colours, Event +from bot.constants import Colours, Event, STAFF_CHANNELS from bot.decorators import respect_role_hierarchy from bot.utils import time from bot.utils.checks import with_role_check @@ -465,6 +465,8 @@ class Infractions(Scheduler, commands.Cog): if infraction["actor"] == self.bot.user.id: end_msg = f" (reason: {infraction['reason']})" + elif ctx.channel.id not in STAFF_CHANNELS: + end_msg = '' else: infractions = await self.bot.api_client.get( "bot/infractions", -- cgit v1.2.3