【发布时间】:2021-11-18 11:34:50
【问题描述】:
我无法在 replti.com 中启动我的不和谐机器人 他们的代码有什么问题吗?
import os
client = discord.Client()
@client.event
async def on_ready():
print("I'm in")
print(client.user)
@client.event
async def on_message(message):
if message.author != client.user:
await message.channel.send(message.content[::-1])
my_secret = os.environ['TOKEN']
client.run(my_secret)
【问题讨论】:
-
你导入discord了吗?
-
是的,我导入了不和谐模块
-
import discord未出现在您的代码中。因此,如果您已导入它,请在您的问题中进行更改,以造福他人
标签: python-3.x python-requests discord discord.py