reminder.py 文件源码

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

项目:PyMiki 作者: TheGrammarJew 项目源码 文件源码
def reminder(self, ctx, *, when: time.UserFriendlyTime(commands.clean_content, default='something')):
        """Reminds you of something after a certain amount of time.

        The input can be any direct date (e.g. YYYY-MM-DD) or a human
        readable offset. Examples:

        - "next thursday at 3pm do something funny"
        - "do the dishes tomorrow"
        - "in 3 days do the thing"
        - "2d unmute someone"

        Times are in UTC.
        """

        timer = await self.create_timer(when.dt, 'reminder', ctx.author.id, ctx.channel.id, when.arg, connection=ctx.db)
        delta = time.human_timedelta(when.dt, source=ctx.message.created_at)
        await ctx.send(f"Alright {ctx.author.mention}, I'll remind you about {when.arg} in {delta}.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号