mentiontracker.py 文件源码

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

项目:palmtree5-cogs 作者: palmtree5 项目源码 文件源码
def listwords(self, ctx: commands.Context, channel: discord.Channel=None):
        """List all words for the specified channel
        Optional parameters:
        - channel: the channel to show words for (defaults to the current channel)"""
        author = ctx.message.author
        if not channel:
            channel = ctx.message.channel
        if author.id not in self.settings or\
                "words" not in self.settings[author.id] or\
                channel.id not in self.settings[author.id]["words"] or\
                not self.settings[author.id]["words"][channel.id]:
            await self.bot.say("You haven't set any words to be tracked!")
        else:
            head = "Tracked words for {}#{} in #{}".format(author.name, author.discriminator, channel.name)
            msg = ""
            for word in self.settings[author.id]["words"][channel.id]:
                msg += "{}\n".format(word)
            await self.bot.say(box(msg, lang=head))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号