mod.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Bonfire 作者: Phxntxm 项目源码 文件源码
def unban(self, ctx, member_id: int):
        """Used to unban a member from this server
        Due to the fact that I cannot find a user without being in a server with them
        only the ID should be provided

        EXAMPLE: !unban 353217589321750912
        RESULT: That dude be unbanned"""

        # Lets only accept an int for this method, in order to ensure only an ID is provided
        # Due to that though, we need to ensure a string is passed as the member's ID
        member = discord.Object(id=str(member_id))
        try:
            await self.bot.unban(ctx.message.server, member)
            await self.bot.say("\N{OK HAND SIGN}")
        except discord.Forbidden:
            await self.bot.say("But I can't, muh permissions >:c")
        except discord.HTTPException:
            await self.bot.say("Sorry, I failed to unban that user!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号