不和谐机器人计时器.py

discord-timers的Python项目详细描述


不和谐计时器

discord.py的一个简单扩展,提供基本的计时器支持。

安装

pip install discord-timers -U

示例

importdatetimefromdiscord.extimportcommands,timersbot=commands.Bot(command_prefix="!")bot.timer_manager=timers.TimerManager(bot)@bot.command(name="remind")asyncdefremind(ctx,time,*,text):"""Remind to do something on a date.    The date must be in ``Y/M/D`` format."""date=datetime.datetime(*map(int,time.split("/")))bot.timer_manager.create_timer("reminder",date,args=(ctx.channel.id,ctx.author.id,text))# or without the managertimers.Timer(bot,"reminder",date,args=(ctx.channel.id,ctx.author.id,text)).start()@bot.eventasyncdefon_reminder(channel_id,author_id,text):channel=bot.get_channel(channel_id)awaitchannel.send("Hey, <@{0}>, remember to: {1}".format(author_id,text))bot.run("token")

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java出现编译错误,我不理解   java在gnu-trove库中是否有任何有序映射?   java Servlet应该有映射,但找不到Servlet   java时间和第二期显示1:10,而不是13:10   java Play Framework 1.2.7 Heroku更新崩溃   线程“main”java中的opencsv异常。lang.NoClassDefFoundError:org/apache/commons/lang3/ObjectUtils   selenium在java中隐藏警告消息   java使用ID引用将JSON实体反序列化为POJO   java无法在JRE 8中加载字体   一个线程中的异常/错误会使整个应用程序停止吗?   java访问重复子规则的元素标签;e、 g.用ANTLR解析(1,2,3)中的a   java如何从平移旋转中找到新坐标   使用HTML Java小程序托管jar文件存在安全问题   java如何按频率而不是字母顺序排列字符串数组   java清除bufferedReader和块以获得更多输入   java解密SAML2断言