Skip to content

Commit acb3ec5

Browse files
committed
Add member join/leave message in thread channel
1 parent cd5576a commit acb3ec5

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

bot.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
SOFTWARE.
2323
"""
2424

25-
__version__ = '2.15.1'
25+
__version__ = '2.16.0'
2626

2727
import asyncio
2828
import logging
@@ -718,6 +718,24 @@ async def on_guild_channel_delete(self, channel):
718718
return
719719

720720
await thread.close(closer=mod, silent=True, delete_channel=False)
721+
722+
async def on_member_remove(self, member):
723+
thread = await self.threads.find(recipient=member)
724+
if thread:
725+
em = discord.Embed(
726+
description='The recipient has left the server.',
727+
color=discord.Color.red()
728+
)
729+
await thread.channel.send(embed=em)
730+
731+
async def on_member_join(self, member):
732+
thread = await self.threads.find(recipient=member)
733+
if thread:
734+
em = discord.Embed(
735+
description='The recipient has joined the server.',
736+
color=self.mod_color
737+
)
738+
await thread.channel.send(embed=em)
721739

722740
async def on_message_delete(self, message):
723741
"""Support for deleting linked messages"""

0 commit comments

Comments
 (0)