【发布时间】:2019-09-07 13:33:04
【问题描述】:
我正在设置一个 dicord 机器人,我在数据库上有用户名,所以我从一个连接到数据库的方法中获取用户名,并在字符串中返回用户名我想要从该字符串中提及我无法得到我去上班
我试过在文档上搜索,但我一点也不明白
async def job(channelid,message):
print('init schedule')
channel = client.get_channel(channelid)
current_apps=current_app()
usersapps=apps_user(current_apps["APPS"])
counter=0
while True:
counter= counter + 1
for i in range(0,len(usersapps)):
await discord.client.send_message("{}".format(usersapps[i]['USER']),mentions=True)
await asyncio.sleep(60) # task runs every 60 seconds
我希望我的代码通过来自我的方法的字符串提及给定的用户
我遇到的错误
init schedule
Task exception was never retrieved
future: <Task finished coro=<job() done, defined at c:\Users\Nte\Desktop\rainbow army\bot.py:136> exception=TypeError("send() got an unexpected keyword argument 'mentions'",)>
Traceback (most recent call last):
File "c:\Users\Nte\Desktop\rainbow army\bot.py", line 145, in job
await discord.client.send_message("{}".format(usersapps[i]['USER']),mentions=True)
TypeError: send() got an unexpected keyword argument 'mentions'
【问题讨论】:
标签: python-3.x discord.py