Correct event name

pull/14/head
bobloy 7 years ago
parent 429e0706bd
commit 2e3f9691cd

@ -5,7 +5,9 @@ from redbot.core.commands import Context
class Leaver: class Leaver:
"""Creates a goodbye message when people leave""" """
Creates a goodbye message when people leave
"""
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
@ -29,12 +31,12 @@ class Leaver:
await self.config.guild(guild).channel.set(ctx.channel.id) await self.config.guild(guild).channel.set(ctx.channel.id)
await ctx.send("Channel set to " + ctx.channel.name) await ctx.send("Channel set to " + ctx.channel.name)
async def when_leave(self, member: discord.Member): async def on_member_remove(self, member: discord.Member):
server = member.guild guild = member.guild
channel = await self.config.guild(server).channel() channel = await self.config.guild(guild).channel()
if channel != '': if channel != '':
channel = server.get_channel(channel) channel = guild.get_channel(channel)
await channel.send(str(member) + "(*" + str(member.nick) + "*) has left the server!") await channel.send(str(member) + "(*" + str(member.nick) + "*) has left the server!")
else: else:
pass pass

@ -19,17 +19,12 @@ class Nudity:
def __init__(self, bot: Red): def __init__(self, bot: Red):
self.bot = bot self.bot = bot
self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True) self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True)
default_global = {}
default_guild = { default_guild = {
"enabled": True "enabled": True
} }
default_member = {
"seen": None
}
self.config.register_global(**default_global)
self.config.register_guild(**default_guild) self.config.register_guild(**default_guild)
self.config.register_member(**default_member)
@staticmethod @staticmethod
def get_date_time(s): def get_date_time(s):

Loading…
Cancel
Save