oshimen.py 文件源码

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

项目:YukirinCogs 作者: skeith 项目源码 文件源码
def oshimen(self, ctx, *, oshimen):
        """Who is your oshi?
        Please write the full name with the format of Familyname Givenname
        e.g. [p]write oshimen Kashiwagi Yuki

        [p] = prefix"""

        server = ctx.message.server
        user = ctx.message.author
        prefix = ctx.prefix

        if server.id not in self.oshi:
            self.oshi[server.id] = {}
        else:
            pass

        if not isascii(oshimen):
            await self.bot.say("Oshimens must be written in ASCII characters")
            return
        else:
            pass

        if user.id not in self.oshi[server.id]:
            data = discord.Embed(colour=discord.Color(0xffb6c1))
            data.add_field(
                name="Gomen ne~!",
                value=("You'll need to apply for an Oshimen card to use") +
                (" this feature. Type {}wota").format(prefix) +
                (" to apply for one."))
            await self.bot.say(embed=data)
        else:
            self.oshi[server.id][user.id].update({"Oshimen": oshimen})
            dataIO.save_json(OJSON, self.oshi)
            data = discord.Embed(colour=discord.Color(0xffb6c1))
            data.add_field(name="Yatta! :sparkling_heart:",
                           value=("I am sure {} is very ").format(oshimen) +
                           ("thankful for your support"))
            await self.bot.say(embed=data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号