aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Atul Mishra <[email protected]>2019-10-22 22:43:01 +0530
committerGravatar Atul Mishra <[email protected]>2019-10-22 22:43:01 +0530
commitbd1b7d9a662a9af13f79ae2ae269e97acb498c57 (patch)
tree0525f095a5975a17fa96dbf5796e7ca75a46568e
parentAdd test cases for in_channel_check (diff)
parentMerge pull request #547 from python-discord/#540-dont-show-infraction-total (diff)
Merge branch 'master' into moderator-channel-check
-rw-r--r--bot/cogs/moderation/infractions.py4
-rw-r--r--bot/constants.py9
-rw-r--r--config-default.yml12
3 files changed, 17 insertions, 8 deletions
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",
diff --git a/bot/constants.py b/bot/constants.py
index 1efad8d92..60fc1b723 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -347,13 +347,14 @@ class Channels(metaclass=YAMLGetter):
helpers: int
message_log: int
meta: int
+ mod_spam: int
+ mods: int
mod_alerts: int
modlog: int
- mods: int
- mod_spam: int
off_topic_0: int
off_topic_1: int
off_topic_2: int
+ organisation: int
python: int
reddit: int
talent_pool: int
@@ -395,6 +396,7 @@ class Guild(metaclass=YAMLGetter):
id: int
ignored: List[int]
+ staff_channels: List[int]
class Keys(metaclass=YAMLGetter):
@@ -510,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
+
# Default Channel combinations
MODERATION_CHANNELS = Channels.admins, Channels.admin_spam, Channels.mod_alerts, Channels.mods, Channels.mod_spam
diff --git a/config-default.yml b/config-default.yml
index af024e5de..8e86234ac 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -90,12 +90,12 @@ guild:
channels:
admins: &ADMINS 365960823622991872
- admin_spam: 563594791770914816
+ 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
@@ -106,16 +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
- mods: 305126844661760000
- mod_spam: 620607373828030464
off_topic_0: 291284109232308226
off_topic_1: 463035241142026251
off_topic_2: 463035268514185226
+ organisation: &ORGANISATION 551789653284356126
python: 267624335836053506
reddit: 458224812528238616
staff_lounge: &STAFF_LOUNGE 464905259261755392
@@ -124,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: