Added on_member_join listener. Fixes issue #34.

Added the on_member_join listener. A DM will be sent to the new member upon joining the server.
Fixes issue #34.
Karl 2 years ago committed by GitHub
parent 49b652bdd3
commit 88abf2946d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,6 +16,7 @@ from collections import defaultdict
original_message = {}
ALLOWED_GUILDS = EnvService.get_allowed_guilds()
WELCOME_MESSAGE = EnvService.get_welcome_message()
class GPT3ComCon(commands.Cog, name="GPT3ComCon"):
@ -89,6 +90,12 @@ class GPT3ComCon(commands.Cog, name="GPT3ComCon"):
return False
return True
@commands.Cog.listener()
async def on_member_join(self, member):
welcome_embed = discord.Embed(title=f"Welcome, {member.name}!", description=WELCOME_MESSAGE)
welcome_embed.add_field(name="Just so you know...", value="> My commands are invoked with a forward slash ("/")\n> Use /help to see my help messages.")
await member.send(content=None, embed=welcome_embded)
@commands.Cog.listener()
async def on_member_remove(self, member):
pass

Loading…
Cancel
Save