📅  最后修改于: 2022-03-11 14:46:40.507000             🧑  作者: Mango
@commands.Cog.listener()
async def on_member_remove(self, member):
channel = self.bot.get_channel(805991434330570793)
try:
banned = await member.guild.fetch_ban(member)
except discord.NotFound:
banned = False
if banned:
await channel.send(f"{member} was just banned from the server.")
else:
await channel.send(f"{member} just left the server.")