【发布时间】:2020-10-23 22:12:50
【问题描述】:
我正在开发一个循环,每 5 秒检查一次用户状态是否包含“hi”,如果是这样,它应该给用户一个角色。
我真的不知道该怎么做,但也许有人可以帮忙。
我的代码:
#Here is a little base for the Command i asked...
#I hope it can help you
@tasks.loop(seconds=15)
async def status_role():
if "hi" in ???.lower()
#here comes the code
#(Idk what the code is so i asked you guys :D)
member = ctx.message.author
role = get(member.server.roles, name="Friendly dude")
await bot.add_roles(member, role)
【问题讨论】:
标签: discord discord.py discord.py-rewrite