|
|
|
@ -14,6 +14,26 @@ class EssentialCommands(commands.Cog):
|
|
|
|
|
def __init__(self, bot):
|
|
|
|
|
self.bot = bot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@discord.Cog.listener()
|
|
|
|
|
async def on_member_join(self, member):
|
|
|
|
|
# Send a welcome message with an embed to the specified channel
|
|
|
|
|
welcome_title = esconf['events']['welcome_title']
|
|
|
|
|
welcome_message = esconf['events']['welcome_content']
|
|
|
|
|
welcome_channel = self.bot.get_channel(esconf["events"]['welcome_channel_id'])
|
|
|
|
|
embed = discord.Embed(title=welcome_title.format(member=member), description=welcome_message.format(member=member), color=0x00ff00)
|
|
|
|
|
await welcome_channel.send(embed=embed)
|
|
|
|
|
|
|
|
|
|
@discord.Cog.listener()
|
|
|
|
|
async def on_member_remove(self, member):
|
|
|
|
|
# Send a goodbye message with an embed to the specified channel
|
|
|
|
|
gb_title = esconf['events']['goodbye_title']
|
|
|
|
|
gb_message = esconf['events']['goodbye_content']
|
|
|
|
|
gb_channel = self.bot.get_channel(esconf["events"]['welcome_channel_id'])
|
|
|
|
|
embed = discord.Embed(title=gb_title.format(member=member), description=gb_message.format(member=member), color=0xff0000)
|
|
|
|
|
|
|
|
|
|
await gb_channel.send(embed=embed)
|
|
|
|
|
|
|
|
|
|
@commands.slash_command(guild_ids=guild_ids)
|
|
|
|
|
async def ping(self, ctx):
|
|
|
|
|
if not esconf["commands"]["ping"]:
|
|
|
|
|