Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjr committed Apr 25, 2021
2 parents 3877041 + ea52a8b commit 2e58872
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 19 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ SirReddit:
</a>
<br>

<a href='https://primeserversinc.com/'>
<img height=150 src='https://primeserversinc.com/images/Prime_Logo_P_Sassy.png' style='margin:10px'>
</a>


Become a sponsor on [Patreon](https://patreon.com/kyber).

Expand Down
30 changes: 29 additions & 1 deletion SPONSORS.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,33 @@
}
]
}
},
{
"embed": {
"description": "Quality Hosting at Prices You Deserve!",
"color": 50195251,
"footer": {
"icon_url": "https://primeserversinc.com/images/Prime_Logo_P_Sassy.png",
"text": "Prime Servers, Inc."
},
"thumbnail": {
"url": "https://primeserversinc.com/images/Prime_Logo_P_Sassy.png"
},
"author": {
"name": "Prime Servers, Inc.",
"url": "https://primeserversinc.com",
"icon_url": "https://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)"
}
]
}
}
]
]
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.9.3"
__version__ = "3.9.4"


import asyncio
Expand Down
2 changes: 1 addition & 1 deletion cogs/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
43 changes: 31 additions & 12 deletions cogs/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,25 +673,37 @@ 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")
):
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,
Expand All @@ -704,10 +716,17 @@ async def mention(self, ctx, *mention: Union[discord.Role, discord.Member, str])
self.bot.config.remove("mention")
await self.bot.config.update()
else:
for m in mention:
if not isinstance(m, (discord.Role, discord.Member)):
mention = []
everyone = ("all", "everyone")
for m in user_or_role:
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 for i in mention)
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}".',
Expand Down
3 changes: 2 additions & 1 deletion core/config_help.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.9.0
python-3.9.4

0 comments on commit 2e58872

Please sign in to comment.