【发布时间】:2021-10-02 07:19:16
【问题描述】:
status = None
@client.command()
async def setstatus(ctx, variable):
global status
print("Before", variable)
status = variable
await client.change_presence(activity=discord.Game(next(status)))
await ctx.send(status)
以上是我目前拥有的代码,但它不起作用。
错误: “等待客户端.change_presence(活动=不和谐。游戏(下一个(状态))) TypeError: 'str' 对象不是迭代器"
目标是使用 !setstatus 更改机器人的存在文本。
请帮忙。
【问题讨论】:
-
欢迎来到 StackOverflow。请阅读:stackoverflow.com/help/how-to-ask。它解释了如何改进您的问题,使其更易于阅读和理解确切的问题。希望对您有所帮助!
标签: python-3.x discord discord.py