general.py 文件源码

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

项目:Dota2HelperBot 作者: enoch-ng 项目源码 文件源码
def contact(self, ctx, *, message):
        """Sends a message to the bot owner (60s cooldown).

        Is not affected by Octarine Core, Refresher Orb, Rearm, or cooldown reduction talents."""
        try:
            owner = await self.bot.get_owner()
        except discord.NotFound:
            await self.bot.say("Alas, I know not who my owner is.")
            return

        author = ctx.message.author
        emb = discord.Embed(description = message)
        emb.set_author(name = "Message from %s" % author)

        try:
            await self.bot.send_message(owner, embed = emb)
        except discord.InvalidArgument:
            await self.bot.say("Alas, I know not where my owner is.")
        except discord.HTTPException:
            await self.bot.say("Alas, I could not deliver your message. Perhaps it is too long?")
        except:
            await self.bot.say("Alas, for reasons yet unknown to me, I could not deliver your message.")
        else:
            await self.bot.say("I have delivered your message with utmost haste! I pray it should arrive safely.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号