stars.py 文件源码

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

项目:jose 作者: lnmds 项目源码 文件源码
def starattach(self, ctx, starboard_chan: discord.TextChannel):
        """Attach an existing channel as a starboard.

        With this command you can create your starboard
        without needing José to automatically create the starboard for you
        """
        config = await self.get_starconfig(ctx.guild.id)
        if config:
            return await ctx.send('You already have a starboard config setup.')

        config = empty_starconfig(ctx.guild)
        config['starboard_id'] = starboard_chan.id
        res = await self.starconfig_coll.insert_one(config)

        if not res.acknowledged:
            raise self.SayException('Failed to create starboard config (no ack)')
            return

        await ctx.send('Done!')
        await ctx.ok()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号