shop.py 文件源码

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

项目:Jumper-Cogs 作者: Redjumpman 项目源码 文件源码
def notify_handler(self, settings, ctx, itemname, user, confirmation):
        role = settings["Config"]["Shop Role"]
        if "Role" not in settings["Users"][user.id]["Inventory"][itemname]:
            if settings["Config"]["Shop Notify"] and role is not None:
                msg = ("{} was added to the pending list by {}.\nConfirmation#: {}.\nUser ID: "
                       "{}".format(itemname, user.name, confirmation, user.id))
                names = self.role_check(role, ctx)
                destinations = [m for m in ctx.message.server.members if m.name in names]
                for destination in destinations:
                    await self.bot.send_message(destination, msg)
            await self.bot.say("```{} has been added to pending list. Your confirmation number is "
                               "{}.\nTo check the status of your pending items, use the command "
                               "{}pending check```".format(itemname, confirmation, ctx.prefix))
        else:
            await self.bot.say("{} just received the {} role!".format(user.name, itemname))
        quantity = 1
        self.user_remove_item(settings, user, itemname, quantity)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号