context.py 文件源码

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

项目:dogbot 作者: slice 项目源码 文件源码
def wait_for_response(self):
        """
        Waits for a message response from the message author, then returns the
        new message.

        The message we are waiting for will only be accepted if it was sent by
        the original command invoker, and it was sent in the same channel as
        the command message.
        """

        def check(m):
            if isinstance(m.channel, discord.DMChannel):
                # accept any message, because we are in a dm
                return True
            return m.channel.id == self.channel.id and m.author == self.author

        return await self.bot.wait_for('message', check=check)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号