From a660ad1ae27601620edde08b25d16c9dc06bed62 Mon Sep 17 00:00:00 2001 From: Jeremiah Boby Date: Fri, 14 Jun 2019 17:58:04 +0100 Subject: Accept uppercase and punctuation for off-topic names Resolves #369 --- bot/cogs/off_topic_names.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bot/cogs/off_topic_names.py b/bot/cogs/off_topic_names.py index 2cdaa2c4f..8fbddde4e 100644 --- a/bot/cogs/off_topic_names.py +++ b/bot/cogs/off_topic_names.py @@ -19,7 +19,7 @@ class OffTopicName(Converter): @staticmethod async def convert(ctx: Context, argument: str): - allowed_characters = ("-", "โ€™", "'", "`") + allowed_characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?'`" if not (2 <= len(argument) <= 96): raise BadArgument("Channel name must be between 2 and 96 chars long") @@ -30,11 +30,11 @@ class OffTopicName(Converter): "alphanumeric characters, minus signs or apostrophes." ) - elif not argument.islower(): - raise BadArgument("Channel name must be lowercase") - - # Replace some unusable apostrophe-like characters with "โ€™". - return argument.replace("'", "โ€™").replace("`", "โ€™") + # Replace invalid characters with unicode alternatives. + table = str.maketrans( + allowed_characters, '๐– ๐–ก๐–ข๐–ฃ๐–ค๐–ฅ๐–ฆ๐–ง๐–จ๐–ฉ๐–ช๐–ซ๐–ฌ๐–ญ๐–ฎ๐–ฏ๐–ฐ๐–ฑ๐–ฒ๐–ณ๐–ด๐–ต๐–ถ๐–ท๐–ธ๐–นวƒ๏ผŸโ€™โ€™' + ) + return argument.translate(table) async def update_names(bot: Bot, headers: dict): -- cgit v1.2.3 From 98b20f307d174a2e6db95386cfe3e8c54e12579b Mon Sep 17 00:00:00 2001 From: sco1 Date: Fri, 21 Jun 2019 20:07:28 -0400 Subject: Add Discord Hack Week server to Whitelist --- config-default.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config-default.yml b/config-default.yml index d8016875b..15a897fa4 100644 --- a/config-default.yml +++ b/config-default.yml @@ -165,6 +165,7 @@ filter: - 249111029668249601 # Gentoo - 327254708534116352 # Adafruit - 544525886180032552 # kennethreitz.org + - 590806733924859943 # Discord Hack Week domain_blacklist: - pornhub.com -- cgit v1.2.3 From b92d239cd526d7e389f51d7290a04e262d5e9d51 Mon Sep 17 00:00:00 2001 From: Leon Sandรธy Date: Sat, 22 Jun 2019 16:42:56 +0200 Subject: Adding user-event-announcements to the spamfilter whitelist --- config-default.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config-default.yml b/config-default.yml index 15a897fa4..af0621ece 100644 --- a/config-default.yml +++ b/config-default.yml @@ -115,6 +115,7 @@ guild: staff_lounge: &STAFF_LOUNGE 464905259261755392 talent_pool: &TALENT_POOL 534321732593647616 userlog: 528976905546760203 + user_event_a: &USER_EVENT_A 592000283102674944 verification: 352442727016693763 ignored: [*ADMINS, *MESSAGE_LOG, *MODLOG] @@ -210,6 +211,7 @@ filter: - *STAFF_LOUNGE - *DEVTEST - *TALENT_POOL + - *USER_EVENT_A role_whitelist: - *ADMIN_ROLE -- cgit v1.2.3 From f27c643131ce0a306cf6ecc51d81a4c0c38e418e Mon Sep 17 00:00:00 2001 From: Joseph Banks Date: Sat, 22 Jun 2019 16:50:55 +0100 Subject: add user events announcements to the constants.py class --- bot/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/constants.py b/bot/constants.py index d2c953276..17e60a418 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -352,6 +352,7 @@ class Channels(metaclass=YAMLGetter): reddit: int talent_pool: int userlog: int + user_event_a: int verification: int -- cgit v1.2.3 From fe9482cd9d8bf4b34f1f5d3926695e2d1d5c1e8a Mon Sep 17 00:00:00 2001 From: Joseph Banks Date: Sat, 22 Jun 2019 17:00:39 +0100 Subject: Anti-spam should use the same whitelist as Filters --- bot/cogs/antispam.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bot/cogs/antispam.py b/bot/cogs/antispam.py index 9962fe1c2..03551e806 100644 --- a/bot/cogs/antispam.py +++ b/bot/cogs/antispam.py @@ -10,7 +10,7 @@ from bot.cogs.moderation import Moderation from bot.cogs.modlog import ModLog from bot.constants import ( AntiSpam as AntiSpamConfig, Channels, - Colours, DEBUG_MODE, Event, + Colours, DEBUG_MODE, Event, Filter, Guild as GuildConfig, Icons, Roles, STAFF_ROLES, ) @@ -30,11 +30,6 @@ RULE_FUNCTION_MAPPING = { 'newlines': rules.apply_newlines, 'role_mentions': rules.apply_role_mentions } -WHITELISTED_CHANNELS = ( - Channels.admins, Channels.announcements, Channels.big_brother_logs, - Channels.devlog, Channels.devtest, Channels.helpers, Channels.message_log, - Channels.mod_alerts, Channels.modlog, Channels.staff_lounge -) class AntiSpam: @@ -55,7 +50,7 @@ class AntiSpam: not message.guild or message.guild.id != GuildConfig.id or message.author.bot - or (message.channel.id in WHITELISTED_CHANNELS and not DEBUG_MODE) + or (message.channel.id in Filter.channel_whitelist and not DEBUG_MODE) or (any(role.id in STAFF_ROLES for role in message.author.roles) and not DEBUG_MODE) ): return -- cgit v1.2.3 From 5e16f4a52d59c73a04323e070e7b4a320e8c1e49 Mon Sep 17 00:00:00 2001 From: Jeremiah Boby Date: Sun, 23 Jun 2019 20:50:55 +0100 Subject: Update off_topic_names.py --- bot/cogs/off_topic_names.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/cogs/off_topic_names.py b/bot/cogs/off_topic_names.py index 8fbddde4e..9b0f5d6c5 100644 --- a/bot/cogs/off_topic_names.py +++ b/bot/cogs/off_topic_names.py @@ -19,7 +19,7 @@ class OffTopicName(Converter): @staticmethod async def convert(ctx: Context, argument: str): - allowed_characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?'`" + allowed_characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?'`-" if not (2 <= len(argument) <= 96): raise BadArgument("Channel name must be between 2 and 96 chars long") @@ -32,7 +32,7 @@ class OffTopicName(Converter): # Replace invalid characters with unicode alternatives. table = str.maketrans( - allowed_characters, '๐– ๐–ก๐–ข๐–ฃ๐–ค๐–ฅ๐–ฆ๐–ง๐–จ๐–ฉ๐–ช๐–ซ๐–ฌ๐–ญ๐–ฎ๐–ฏ๐–ฐ๐–ฑ๐–ฒ๐–ณ๐–ด๐–ต๐–ถ๐–ท๐–ธ๐–นวƒ๏ผŸโ€™โ€™' + allowed_characters, '๐– ๐–ก๐–ข๐–ฃ๐–ค๐–ฅ๐–ฆ๐–ง๐–จ๐–ฉ๐–ช๐–ซ๐–ฌ๐–ญ๐–ฎ๐–ฏ๐–ฐ๐–ฑ๐–ฒ๐–ณ๐–ด๐–ต๐–ถ๐–ท๐–ธ๐–นวƒ๏ผŸโ€™โ€™-' ) return argument.translate(table) -- cgit v1.2.3 From 40f39877b522d8d19025f25b536cdc1afe1d2596 Mon Sep 17 00:00:00 2001 From: Leon Sandรธy Date: Sat, 6 Jul 2019 14:32:45 +0200 Subject: Whitelisting the kivy discord server from our filters --- config-default.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config-default.yml b/config-default.yml index af0621ece..91b4d6cce 100644 --- a/config-default.yml +++ b/config-default.yml @@ -167,6 +167,7 @@ filter: - 327254708534116352 # Adafruit - 544525886180032552 # kennethreitz.org - 590806733924859943 # Discord Hack Week + - 423249981340778496 # Kivy domain_blacklist: - pornhub.com -- cgit v1.2.3