我有问题。在此代码中,“ if”处的Seer变量返回未定义。有什么解决方案?
Seer=False
@bot.command(name="watch")
async def setup():
if(Seer==False):
Seer=True
await channel.send("activated")
else:
await channel.send("already activated")
答案 0 :(得分:0)
将Seer变量声明为global
@bot.command(name="watch")
async def setup():
global Seer
if(Seer==False):
Seer=True
await channel.send("activated")
else:
await channel.send("already activated")