From fa6cf626fea876630f2dfad5cfa2bb019e2c8bef Mon Sep 17 00:00:00 2001 From: Jerrie-Aries <70805800+Jerrie-Aries@users.noreply.github.com> Date: Sun, 4 Apr 2021 04:22:33 +0800 Subject: [PATCH 01/10] Update `mention` command. --- cogs/utility.py | 45 +++++++++++++++++++++++++++++++------------ core/config_help.json | 3 ++- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/cogs/utility.py b/cogs/utility.py index 8ce7af5b69..51ed2b476d 100644 --- a/cogs/utility.py +++ b/cogs/utility.py @@ -673,41 +673,62 @@ async def ping(self, ctx): @commands.command() @checks.has_permissions(PermissionLevel.ADMINISTRATOR) - async def mention(self, ctx, *mention: Union[discord.Role, discord.Member, str]): + async def mention(self, ctx, *user_or_role: Union[discord.Role, discord.Member, str]): """ Change what the bot mentions at the start of each thread. - Type only `{prefix}mention` to retrieve your current "mention" message. - `{prefix}mention disable` to disable mention. - `{prefix}mention reset` to reset it to default value. + `user_or_role` may be a user ID, mention, name, role ID, mention, or name. + You can also set it to mention multiple users or roles, just separate the arguments with space. + + Examples: + - `{prefix}mention @user` + - `{prefix}mention @user @role` + - `{prefix}mention 984301093849028 388218663326449` + - `{prefix}mention everyone` + + Do not ping `@everyone` to set mention to everyone, use "everyone" or "all" instead. + + Notes: + - Type only `{prefix}mention` to retrieve your current "mention" message. + - `{prefix}mention disable` to disable mention. + - `{prefix}mention reset` to reset it to default value, which is "@here". """ current = self.bot.config["mention"] - if not mention: + if not user_or_role: embed = discord.Embed( title="Current mention:", color=self.bot.main_color, description=str(current) ) elif ( - len(mention) == 1 - and isinstance(mention[0], str) - and mention[0].lower() in ["disable", "reset"] + len(user_or_role) == 1 + and isinstance(user_or_role[0], str) + and user_or_role[0].lower() in ("disable", "reset", "all", "everyone") ): - option = mention[0].lower() + option = user_or_role[0].lower() if option == "disable": embed = discord.Embed( description=f"Disabled mention on thread creation.", color=self.bot.main_color, ) self.bot.config["mention"] = None - else: + elif option == "reset": embed = discord.Embed( description="`mention` is reset to default.", color=self.bot.main_color, ) self.bot.config.remove("mention") + else: + embed = discord.Embed( + title="Changed mention!", + description=f'On thread creation the bot now says "@everyone".', + color=self.bot.main_color, + ) + self.bot.config["mention"] = "@everyone" await self.bot.config.update() else: - for m in mention: + for m in user_or_role: if not isinstance(m, (discord.Role, discord.Member)): raise commands.BadArgument(f'Role or Member "{m}" not found.') - mention = " ".join(i.mention for i in mention) + mention = " ".join( + i.mention if i is not ctx.guild.default_role else str(i) for i in user_or_role + ) embed = discord.Embed( title="Changed mention!", description=f'On thread creation the bot now says "{mention}".', diff --git a/core/config_help.json b/core/config_help.json index e764c9255d..d430b9ee4c 100644 --- a/core/config_help.json +++ b/core/config_help.json @@ -52,7 +52,8 @@ "`{prefix}mention Yo~ Here's a new thread for ya!`" ], "notes": [ - "Unfortunately, it's not currently possible to disable mention. You do not have to include a mention." + "To disable mention, use command `{prefix}mention disable`.", + "See also: `{prefix}help mention`." ] }, "main_color": { From a4389b43192edf44547e6cc6b8e0a32b15bf9aa3 Mon Sep 17 00:00:00 2001 From: Ralph Date: Mon, 5 Apr 2021 10:39:57 -0400 Subject: [PATCH 02/10] Add Coolguy (Prime Servers) to SPONSORS --- SPONSORS.json | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/SPONSORS.json b/SPONSORS.json index fcabb119ac..98abe37d81 100644 --- a/SPONSORS.json +++ b/SPONSORS.json @@ -42,5 +42,33 @@ } ] } - } -] \ No newline at end of file + }, + { + "embed": { + "description": "Quality Hosting at Prices You Deserve!", + "color": 50195251 + "footer": { + "icon_url": "http://primeserversinc.com/images/Prime_Logo_P_Sassy.png", + "text": "Prime Servers, Inc." + }, + "thumbnail": { + "url": "http://primeserversinc.com/images/Prime_Logo_P_Sassy.png" + }, + "author": { + "name": "Prime Servers, Inc.", + "url": "https://primeserversinc.com", + "icon_url": "http://primeserversinc.com/images/Prime_Logo_P_Sassy.png" + }, + "fields": [ + { + "name": "Twitter", + "value": "[**Click Here**](https://twitter.com/PrimeServersInc)" + }, + { + "name": "Discord Server", + "value": "[**Click Here**](https://discord.gg/cYM6Urn)" + } + ] + } + }, +] From d77d47dfdecc0e20f9868c4e62ec4baee932e66d Mon Sep 17 00:00:00 2001 From: Ralph Date: Mon, 5 Apr 2021 10:41:27 -0400 Subject: [PATCH 03/10] Small correction --- SPONSORS.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPONSORS.json b/SPONSORS.json index 98abe37d81..a57ac2d60e 100644 --- a/SPONSORS.json +++ b/SPONSORS.json @@ -46,7 +46,7 @@ { "embed": { "description": "Quality Hosting at Prices You Deserve!", - "color": 50195251 + "color": 50195251, "footer": { "icon_url": "http://primeserversinc.com/images/Prime_Logo_P_Sassy.png", "text": "Prime Servers, Inc." @@ -70,5 +70,5 @@ } ] } - }, + } ] From b4ac84f78fd1cff8e1b83ce88660fa1242df1429 Mon Sep 17 00:00:00 2001 From: Ralph Date: Mon, 5 Apr 2021 10:42:25 -0400 Subject: [PATCH 04/10] Add Coolguy (Prime Servers) to SPONSORS --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 10f7baf737..19b9eed923 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,10 @@ Special thanks to our sponsors for supporting the project. + + + + Become a sponsor on [Patreon](https://patreon.com/kyber). From 4f52b685d1659d870bff2b0d8ad3bd6cc8c32698 Mon Sep 17 00:00:00 2001 From: Ralph Date: Tue, 6 Apr 2021 16:51:21 -0400 Subject: [PATCH 05/10] Update to HTTPS --- SPONSORS.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SPONSORS.json b/SPONSORS.json index a57ac2d60e..53034c57b3 100644 --- a/SPONSORS.json +++ b/SPONSORS.json @@ -48,16 +48,16 @@ "description": "Quality Hosting at Prices You Deserve!", "color": 50195251, "footer": { - "icon_url": "http://primeserversinc.com/images/Prime_Logo_P_Sassy.png", + "icon_url": "https://primeserversinc.com/images/Prime_Logo_P_Sassy.png", "text": "Prime Servers, Inc." }, "thumbnail": { - "url": "http://primeserversinc.com/images/Prime_Logo_P_Sassy.png" + "url": "https://primeserversinc.com/images/Prime_Logo_P_Sassy.png" }, "author": { "name": "Prime Servers, Inc.", "url": "https://primeserversinc.com", - "icon_url": "http://primeserversinc.com/images/Prime_Logo_P_Sassy.png" + "icon_url": "https://primeserversinc.com/images/Prime_Logo_P_Sassy.png" }, "fields": [ { From 4da97a7ecb5381f9568bef0e19c59df745f2b616 Mon Sep 17 00:00:00 2001 From: Ralph Date: Tue, 6 Apr 2021 16:51:45 -0400 Subject: [PATCH 06/10] Update to HTTPS --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 19b9eed923..a211cf22a0 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ Special thanks to our sponsors for supporting the project. - + From ac2e0c6e1423c485cebd3b50aeb44371102b1e42 Mon Sep 17 00:00:00 2001 From: Jerrie-Aries <70805800+Jerrie-Aries@users.noreply.github.com> Date: Tue, 13 Apr 2021 06:39:41 +0800 Subject: [PATCH 07/10] Cleaner code :D --- cogs/utility.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/cogs/utility.py b/cogs/utility.py index 51ed2b476d..7b39631dcd 100644 --- a/cogs/utility.py +++ b/cogs/utility.py @@ -701,7 +701,7 @@ async def mention(self, ctx, *user_or_role: Union[discord.Role, discord.Member, elif ( len(user_or_role) == 1 and isinstance(user_or_role[0], str) - and user_or_role[0].lower() in ("disable", "reset", "all", "everyone") + and user_or_role[0].lower() in ("disable", "reset") ): option = user_or_role[0].lower() if option == "disable": @@ -709,26 +709,24 @@ async def mention(self, ctx, *user_or_role: Union[discord.Role, discord.Member, description=f"Disabled mention on thread creation.", color=self.bot.main_color, ) self.bot.config["mention"] = None - elif option == "reset": + else: embed = discord.Embed( description="`mention` is reset to default.", color=self.bot.main_color, ) self.bot.config.remove("mention") - else: - embed = discord.Embed( - title="Changed mention!", - description=f'On thread creation the bot now says "@everyone".', - color=self.bot.main_color, - ) - self.bot.config["mention"] = "@everyone" await self.bot.config.update() else: + mention = [] + everyone = ("all", "everyone") for m in user_or_role: - if not isinstance(m, (discord.Role, discord.Member)): + if not isinstance(m, (discord.Role, discord.Member)) and m not in everyone: raise commands.BadArgument(f'Role or Member "{m}" not found.') - mention = " ".join( - i.mention if i is not ctx.guild.default_role else str(i) for i in user_or_role - ) + elif m == ctx.guild.default_role or m in everyone: + mention.append("@everyone") + continue + mention.append(m.mention) + + mention = " ".join(mention) embed = discord.Embed( title="Changed mention!", description=f'On thread creation the bot now says "{mention}".', From c74e5f4ccbf0695b545e5d362897230b24472002 Mon Sep 17 00:00:00 2001 From: codeinteger6 <44692189+codeinteger6@users.noreply.github.com> Date: Wed, 14 Apr 2021 13:25:19 +0600 Subject: [PATCH 08/10] Bump python runtime version Security update --- runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime.txt b/runtime.txt index 67068f10fe..87665291b8 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.9.0 \ No newline at end of file +python-3.9.4 From b557a9bf16cfb37a78e1c932a30420cb1c551992 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee <28086837+fourjr@users.noreply.github.com> Date: Sun, 25 Apr 2021 21:37:23 +0800 Subject: [PATCH 09/10] There is now a proper message when trying to contact a bot. --- cogs/modmail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/modmail.py b/cogs/modmail.py index a45da27166..87b9d91e57 100644 --- a/cogs/modmail.py +++ b/cogs/modmail.py @@ -1014,7 +1014,7 @@ async def contact( embed = discord.Embed( color=self.bot.error_color, description="Cannot start a thread with a bot." ) - return await ctx.send(embed=embed, delete_afer=3) + return await ctx.send(embed=embed, delete_after=3) exists = await self.bot.threads.find(recipient=user) if exists: From ea52a8bf4079eee1293ebb2ccbef4dc45fe23416 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee <28086837+fourjr@users.noreply.github.com> Date: Sun, 25 Apr 2021 21:40:25 +0800 Subject: [PATCH 10/10] Changelog - v3.9.4 --- CHANGELOG.md | 20 ++++++++++++++++++-- bot.py | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df4c140165..ddb87eebc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,14 +6,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html); however, insignificant breaking changes do not guarantee a major version bump, see the reasoning [here](https://github.com/kyb3r/modmail/issues/319). If you're a plugin developer, note the "BREAKING" section. +# v3.9.4 + +## Fixed + +- Certain cases where fallback categories were not working as intended. ([GH #3002](https://github.com/kyb3r/modmail/issues/3002), [PR #3003](https://github.com/kyb3r/modmail/pull/3003)) +- There is now a proper message when trying to contact a bot.+ + +## Improved + +- `?mention` can now be disabled with `?mention disable`. ([PR #2993](https://github.com/kyb3r/modmail/pull/2993/files)) +- `?mention` now allows vague entries such as `everyone` or `all`. ([PR #2993](https://github.com/kyb3r/modmail/pull/2993/files)) + +## Internal + +- Change heroku python version to 3.9.4 [PR #3001](https://github.com/kyb3r/modmail/pull/3001) + # v3.9.3 ## Added -- New config: ` use_user_id_channel_name`, when set to TRUE, channel names would get created with the recipient's ID instead of their name and discriminator. +- New config: `use_user_id_channel_name`, when set to TRUE, channel names would get created with the recipient's ID instead of their name and discriminator. - This is now an option to better suit the needs of servers in Server Discovery -## Internal Change +## Internal - Signature of `format_channel_name` in core/util.py changed to: - `format_channel_name(bot, author, exclude_channel=None, force_null=False)` diff --git a/bot.py b/bot.py index 994e956e11..1b9a9f2c1f 100644 --- a/bot.py +++ b/bot.py @@ -1,4 +1,4 @@ -__version__ = "3.9.3" +__version__ = "3.9.4" import asyncio