From 84719b175cf4702d5320c228313d80848e347ab5 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Wed, 5 Dec 2018 00:57:42 +0100 Subject: Fixes a bug with the watch alias introduced by our recent change of the watch command. --- bot/cogs/alias.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/cogs/alias.py b/bot/cogs/alias.py index 12edb202f..7824b2c6b 100644 --- a/bot/cogs/alias.py +++ b/bot/cogs/alias.py @@ -1,7 +1,7 @@ import inspect import logging -from discord import Colour, Embed, TextChannel, User +from discord import Colour, Embed, User from discord.ext.commands import ( Command, Context, clean_content, command, group ) @@ -71,13 +71,13 @@ class Alias: @command(name="watch", hidden=True) async def bigbrother_watch_alias( - self, ctx, user: User, channel: TextChannel = None + self, ctx, user: User, reason: str = None ): """ Alias for invoking bigbrother watch user [text_channel]. """ - await self.invoke(ctx, "bigbrother watch", user, channel) + await self.invoke(ctx, "bigbrother watch", user, reason=reason) @command(name="unwatch", hidden=True) async def bigbrother_unwatch_alias(self, ctx, user: User): -- cgit v1.2.3 From b85699ab48be91a3a170c8bad373f1bc91a85096 Mon Sep 17 00:00:00 2001 From: scragly <29337040+scragly@users.noreply.github.com> Date: Wed, 5 Dec 2018 13:13:10 +0100 Subject: Update bot/cogs/alias.py Co-Authored-By: heavysaturn --- bot/cogs/alias.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/cogs/alias.py b/bot/cogs/alias.py index 7824b2c6b..2ce4a51e3 100644 --- a/bot/cogs/alias.py +++ b/bot/cogs/alias.py @@ -71,7 +71,7 @@ class Alias: @command(name="watch", hidden=True) async def bigbrother_watch_alias( - self, ctx, user: User, reason: str = None + self, ctx, user: User, *, reason: str = None ): """ Alias for invoking bigbrother watch user [text_channel]. -- cgit v1.2.3 From 8e5886566d970f9fa6aec8a357bbf5c212b792fe Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Wed, 5 Dec 2018 21:29:57 +0100 Subject: Adding git to the base dockerfile --- docker/base.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/base.Dockerfile b/docker/base.Dockerfile index a1ec0866e..e46db756a 100644 --- a/docker/base.Dockerfile +++ b/docker/base.Dockerfile @@ -8,6 +8,7 @@ RUN apk add --update jpeg-dev RUN apk add --update libxml2 libxml2-dev libxslt-dev RUN apk add --update zlib-dev RUN apk add --update freetype-dev +RUN apk add --update git ENV LIBRARY_PATH=/lib:/usr/lib ENV PIPENV_VENV_IN_PROJECT=1 -- cgit v1.2.3 From 81b0bfaac0a1ac3d8c810d15aee51939f622fd4c Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Tue, 18 Dec 2018 15:43:12 +0100 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfa9d3e42..1c9e52b71 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,5 @@ [![Build Status](https://dev.azure.com/python-discord/Python%20Discord/_apis/build/status/Bot%20(Mainline))](https://dev.azure.com/python-discord/Python%20Discord/_build/latest?definitionId=1) [![Discord](https://discordapp.com/api/guilds/267624335836053506/embed.png)](https://discord.gg/2B963hn) -This project is a Discord bot specifically for use with the Python Discord server. It will provide numerous utilities +This project is a Discord bot specifically for use with the Python Discord server. It provides numerous utilities and other tools to help keep the server running like a well-oiled machine. -- cgit v1.2.3 From 820cb0c1e838faefd898bd10f5dc767a86ec84f7 Mon Sep 17 00:00:00 2001 From: sco1 Date: Tue, 18 Dec 2018 16:55:53 -0500 Subject: Make reason a required input to bb watch Resolves #218 --- bot/cogs/bigbrother.py | 14 +++++++++----- 1 file 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) -- cgit v1.2.3 From 97bedd10cd6c3e1760e115022915566337e42c60 Mon Sep 17 00:00:00 2001 From: sco1 Date: Thu, 20 Dec 2018 16:34:32 -0500 Subject: Fix initial emoji config Resolves #220 --- config-default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-default.yml b/config-default.yml index 41383a6ae..c173330d2 100644 --- a/config-default.yml +++ b/config-default.yml @@ -25,7 +25,7 @@ style: green_chevron: "<:greenchevron:418104310329769993>" red_chevron: "<:redchevron:418112778184818698>" white_chevron: "<:whitechevron:418110396973711363>" - lemoneye2: "<:lemoneye2:435193765582340098>" + bb_message: "<:lemoneye2:435193765582340098>" status_online: "<:status_online:470326272351010816>" status_idle: "<:status_idle:470326266625785866>" -- cgit v1.2.3 From d19bd1315d84dbd28af8e96e70e6d079a668b443 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 20 Dec 2018 16:53:42 -0500 Subject: Update config-default.yml Co-Authored-By: sco1 --- config-default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-default.yml b/config-default.yml index c173330d2..25c8b1e6d 100644 --- a/config-default.yml +++ b/config-default.yml @@ -25,7 +25,7 @@ style: green_chevron: "<:greenchevron:418104310329769993>" red_chevron: "<:redchevron:418112778184818698>" white_chevron: "<:whitechevron:418110396973711363>" - bb_message: "<:lemoneye2:435193765582340098>" + bb_message: "<:bbmessage:472476937504423936>" status_online: "<:status_online:470326272351010816>" status_idle: "<:status_idle:470326266625785866>" -- cgit v1.2.3 From d619603cf947ebaea73db387c39e20c9074ae9d1 Mon Sep 17 00:00:00 2001 From: sco1 Date: Thu, 20 Dec 2018 17:08:19 -0500 Subject: Realigned emoji groupings --- config-default.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config-default.yml b/config-default.yml index 25c8b1e6d..e7145289d 100644 --- a/config-default.yml +++ b/config-default.yml @@ -19,13 +19,13 @@ style: emojis: defcon_disabled: "<:defcondisabled:470326273952972810>" - defcon_enabled: "<:defconenabled:470326274213150730>" - defcon_updated: "<:defconsettingsupdated:470326274082996224>" + defcon_enabled: "<:defconenabled:470326274213150730>" + defcon_updated: "<:defconsettingsupdated:470326274082996224>" green_chevron: "<:greenchevron:418104310329769993>" red_chevron: "<:redchevron:418112778184818698>" white_chevron: "<:whitechevron:418110396973711363>" - bb_message: "<:bbmessage:472476937504423936>" + bb_message: "<:bbmessage:472476937504423936>" status_online: "<:status_online:470326272351010816>" status_idle: "<:status_idle:470326266625785866>" @@ -42,7 +42,7 @@ style: crown_green: "https://cdn.discordapp.com/emojis/469964154719961088.png" crown_red: "https://cdn.discordapp.com/emojis/469964154879344640.png" - defcon_denied: "https://cdn.discordapp.com/emojis/472475292078964738.png" + defcon_denied: "https://cdn.discordapp.com/emojis/472475292078964738.png" defcon_disabled: "https://cdn.discordapp.com/emojis/470326273952972810.png" defcon_enabled: "https://cdn.discordapp.com/emojis/470326274213150730.png" defcon_updated: "https://cdn.discordapp.com/emojis/472472638342561793.png" @@ -68,8 +68,8 @@ style: user_unban: "https://cdn.discordapp.com/emojis/469952898692808704.png" user_update: "https://cdn.discordapp.com/emojis/469952898684551168.png" - user_mute: "https://cdn.discordapp.com/emojis/472472640100106250.png" - user_unmute: "https://cdn.discordapp.com/emojis/472472639206719508.png" + user_mute: "https://cdn.discordapp.com/emojis/472472640100106250.png" + user_unmute: "https://cdn.discordapp.com/emojis/472472639206719508.png" user_verified: "https://cdn.discordapp.com/emojis/470326274519334936.png" pencil: "https://cdn.discordapp.com/emojis/470326272401211415.png" -- cgit v1.2.3 From 4716565247ea749193f19f0e95e05eeaf4d70288 Mon Sep 17 00:00:00 2001 From: sco1 Date: Mon, 24 Dec 2018 16:39:40 -0500 Subject: Remove reason check --- bot/cogs/bigbrother.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bot/cogs/bigbrother.py b/bot/cogs/bigbrother.py index 0f2cc7ac8..31dbf8b5e 100644 --- a/bot/cogs/bigbrother.py +++ b/bot/cogs/bigbrother.py @@ -216,18 +216,13 @@ class BigBrother: @bigbrother_group.command(name='watch', aliases=('w',)) @with_role(Roles.owner, Roles.admin, Roles.moderator) - async def watch_command(self, ctx: Context, user: User, *, reason: str = None): + async def watch_command(self, ctx: Context, user: User, *, reason: str): """ Relay messages sent by the given `user` to the `#big-brother-logs` channel 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 = { -- cgit v1.2.3 From 6b49afeb6afe6ecdbc5325723c3106588b85c62b Mon Sep 17 00:00:00 2001 From: sco1 Date: Mon, 24 Dec 2018 16:40:24 -0500 Subject: Add linebreak --- bot/cogs/bigbrother.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/cogs/bigbrother.py b/bot/cogs/bigbrother.py index 31dbf8b5e..29b13f038 100644 --- a/bot/cogs/bigbrother.py +++ b/bot/cogs/bigbrother.py @@ -223,6 +223,7 @@ class BigBrother: A `reason` for watching is required, which is added for the user to be watched as a note (aka: shadow warning) """ + channel_id = Channels.big_brother_logs post_data = { -- cgit v1.2.3