Skip to content

Commit c5db7b9

Browse files
committed
Improve react to contact, add docstring to selfcontact
1 parent 3905f9b commit c5db7b9

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html);
77
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.
88

9+
# v3.7.1
10+
11+
### Fixed
12+
13+
- Bot will now leave a reaction on the react to contact message.
14+
- Added docstring to selfcontact
15+
916
# v3.7.0
1017

1118
### Added

bot.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.7.0"
1+
__version__ = "3.7.1"
22

33

44
import asyncio
@@ -1166,14 +1166,17 @@ async def on_raw_reaction_add(self, payload):
11661166
if emoji_fmt == react_message_emoji:
11671167
channel = self.get_channel(payload.channel_id)
11681168
member = channel.guild.get_member(payload.user_id)
1169-
message = await channel.fetch_message(payload.message_id)
1170-
await message.remove_reaction(payload.emoji, member)
1169+
if not member.bot:
1170+
message = await channel.fetch_message(payload.message_id)
1171+
await message.remove_reaction(payload.emoji, member)
1172+
1173+
ctx = await self.get_context(message)
1174+
ctx.author = member
1175+
await ctx.invoke(
1176+
self.get_command("contact"), user=member, manual_trigger=False
1177+
)
11711178

1172-
ctx = await self.get_context(message)
1173-
ctx.author = member
1174-
await ctx.invoke(
1175-
self.get_command("contact"), user=member, manual_trigger=False
1176-
)
1179+
await message.add_reaction(emoji_fmt) # bot adds as well
11771180

11781181
async def on_raw_reaction_remove(self, payload):
11791182
if self.config["transfer_reactions"]:

cogs/modmail.py

+1
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ async def edit(self, ctx, message_id: Optional[int] = None, *, message: str):
940940
@commands.command()
941941
@checks.has_permissions(PermissionLevel.REGULAR)
942942
async def selfcontact(self, ctx):
943+
"""Creates a thread with yourself"""
943944
await ctx.invoke(self.contact, user=ctx.author)
944945

945946
@commands.command(usage="<user> [category] [options]")

0 commit comments

Comments
 (0)