shop.py 文件源码

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

项目:Jumper-Cogs 作者: Redjumpman 项目源码 文件源码
def _addrole_shop(self, ctx, quantity: int, cost: int, role: discord.Role):
        """Add a role token to shop list. Requires buyrole from refactored cogs"""
        server = ctx.message.server
        settings = self.check_server_settings(server)
        shop_name = settings["Config"]["Shop Name"]
        if 'Buyrole' not in self.bot.cogs:
            msg = ("This feature requires the buyrole cog from the Refactored Cogs repo.\n"
                   "Load buyrole to use this function.")
        else:
            self.shop_item_add(settings, role, cost, quantity, role=True)
            item_count = len(settings["Shop List"])
            msg = ("```{} {} have been added to {} shop.\n{} item(s) available for purchase in the "
                   "store.```".format(quantity, role.name, shop_name, item_count))
        await self.bot.say(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号