【发布时间】:2021-03-14 01:04:49
【问题描述】:
我正在尝试为我的 discord 机器人编写一段代码,当我的一个朋友的个人资料状态从离线更新为在线时,它会通知我。
目前,我正在摆弄一些代码,这是我目前所拥有的:
@client.event
async def on_member_update(before, after)
if str(before.status) == "offline":
if str(after.status) == "online":
await message.channel.send(f"""{} is now {}""".format(after.name,after.status))
这似乎不起作用。
【问题讨论】:
-
Aghgh 格式不太好,请想象每个冒号后都有适当的缩进。
-
提示:您可以通过点击问题下方的编辑按钮来编辑您的问题
标签: python discord bots discord.py