Repository: python-discord/bot

Issue:
Don't show infraction total outside staff channels.
Currently, when we deliver an infraction, it will show the infraction total in the bot's response.

![image](https://user-images.githubusercontent.com/2098517/66942037-70113c00-f048-11e9-8867-114b2339a1ac.png)

This is a cool feature, but should not happen in public channels. So let's do something about that.

### Infraction total should be allowed in the following channels:
```
#admins        ID: 365960823622991872
#admin-spam    ID: 563594791770914816
#mod-spam      ID: 620607373828030464
#mods          ID: 305126844661760000
#helpers       ID: 385474242440986624
#organisation  ID: 551789653284356126
#defcon        ID: 464469101889454091
```

If the command is called in any other channel, **do not show the infraction total**. This applies to all moderation commands that currently show the total.

If any of the above channels are not currently registered as constants, please create new constants for them. The above list of channels can be stored as a group constant called `STAFF_CHANNELS`. Make use of [YAML node anchors](https://yaml.org/spec/1.2/spec.html#&%20anchor//) when you do this.



Discussion:
Hi, I would like to work on this please. 

Resolving patch:
diff --git a/bot/cogs/moderation/infractions.py b/bot/cogs/moderation/infractions.py
--- a/bot/cogs/moderation/infractions.py
+++ b/bot/cogs/moderation/infractions.py
@@ -12,7 +12,7 @@
 
 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 @@ async def apply_infraction(
 
         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
--- 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 @@ class RedirectOutput(metaclass=YAMLGetter):
 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 = [


Test patch: