diff options
| author | 2018-12-18 16:55:53 -0500 | |
|---|---|---|
| committer | 2018-12-18 16:58:09 -0500 | |
| commit | 820cb0c1e838faefd898bd10f5dc767a86ec84f7 (patch) | |
| tree | 9253843e3371b2682c0e41bc10a7d60188b59259 | |
| parent | Update README.md (diff) | |
Make reason a required input to bb watch
Resolves #218
| -rw-r--r-- | bot/cogs/bigbrother.py | 14 | 
1 files changed, 9 insertions, 5 deletions
| diff --git a/bot/cogs/bigbrother.py b/bot/cogs/bigbrother.py index 7964c81a8..0f2cc7ac8 100644 --- a/bot/cogs/bigbrother.py +++ b/bot/cogs/bigbrother.py @@ -220,9 +220,14 @@ class BigBrother:          """          Relay messages sent by the given `user` to the `#big-brother-logs` channel -        If a `reason` is specified, a note is added for `user` +        A `reason` for watching is required, which is added for the user to be watched as a +        note (aka: shadow warning)          """ +        if not reason: +            await ctx.send(":x: A reason for watching this user is required") +            return +          channel_id = Channels.big_brother_logs          post_data = { @@ -251,10 +256,9 @@ class BigBrother:                  reason = data.get('error_message', "no message provided")                  await ctx.send(f":x: the API returned an error: {reason}") -        # Add a note (shadow warning) if a reason is specified -        if reason: -            reason = "bb watch: " + reason  # Prepend for situational awareness -            await post_infraction(ctx, user, type="warning", reason=reason, hidden=True) +        # Add a note (shadow warning) with the reason for watching +        reason = "bb watch: " + reason  # Prepend for situational awareness +        await post_infraction(ctx, user, type="warning", reason=reason, hidden=True)      @bigbrother_group.command(name='unwatch', aliases=('uw',))      @with_role(Roles.owner, Roles.admin, Roles.moderator) | 
