【发布时间】:2019-11-25 10:49:26
【问题描述】:
我正在尝试设置一个不和谐的机器人,当网站上发生各种变化时通知我。我正在使用 python 和 discord.py 重写。
我发现的所有示例和教程都需要用户调用机器人,但是我需要机器人依赖外部提示(网站正在更新)而不是用户交互。
async def send_notification(content):
client = discord.Client()
user = client.fetch_user(0000000)
if user is not None:
await user.send(content)
client.run("TOKEN")
我收到以下消息:RuntimeWarning: coroutine 'send_notification' was never waiting
【问题讨论】:
-
您的网站监控是如何工作的?它是按计划运行,还是主动监控网站的变化?
-
你可以使用 webhook。
标签: python bots discord.py discord.py-rewrite