【问题标题】:Is there a way to make a discord bot do something automatically (without message)?有没有办法让不和谐的机器人自动做某事(没有消息)?
【发布时间】:2020-11-19 10:13:51
【问题描述】:

我最近一直在制作一个不和谐的机器人游戏,并希望有玩家可以加入和竞争的日常活动。但我希望这些活动自动出现,而不需要客户端做任何事情。我考虑过使用不和谐提供的cooldown() 功能和time.sleep()。但是机器人如何知道将消息发送到哪里?

如果我尝试过,这是一个简短的部分:

import discord
from discord.ext.commands import command, cooldown

@cooldown(1, 86400, '''What type should I use here?''')
async def '''what kind of function?'''():
   await '''What should I use to send'''("@everyone, a new event has appeared! **INFO**...")

【问题讨论】:

    标签: python discord.py-rewrite


    【解决方案1】:

    为此,您应该使用tasks。文档中有示例。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-30
    • 2023-04-04
    • 2020-12-31
    • 2021-01-23
    • 2021-03-28
    • 2020-02-18
    • 2021-04-18
    • 2020-07-21
    相关资源
    最近更新 更多