mine.py 文件源码

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

项目:kitsuchan-2 作者: n303p4 项目源码 文件源码
def mine(self, ctx, *, user: discord.Member):
        """Set a tripmine for someone. Tripmines go off at random.

        * user - The person for which the mine will go off.
        """
        if user.id == ctx.bot.user.id:
            await ctx.send("Nope. :3")
        elif (ctx.channel.id in self.tripmines.keys() and
              self.tripmines[ctx.channel.id].has_member(user.id)):
            raise commands.UserInputError(f"A tripmine is already set for {user.display_name}.")
        else:
            self.tripmines.setdefault(ctx.channel.id, TripmineChannelArray())
            self.tripmines[ctx.channel.id].add_member(user.id)
            message = await ctx.send(f"Tripmine set for {user.display_name}! :3")
            await asyncio.sleep(3)
            await message.delete()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号