📌  相关文章
📜  如果用户被禁止发送消息 discord.py - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:40.507000             🧑  作者: Mango

代码示例1
@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.")