当我尝试运行我的代码时,出现以下错误:
我不知道如何解决它。我已经查看了类似于我问题的帖子,但它们的修复方法似乎没有起作用。这是我所有的代码:
\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe: can't find '__main__' module in ''
。我不知道如何解决它。我已经查看了类似于我问题的帖子,但它们的修复方法似乎没有起作用。这是我所有的代码:
import discord
client = discord.client()
@client.event
async def on_ready():
print(f"we have logged in as {client.user}")
client.run("my bot token would be here")
@client.event
async def on_message(message): # event that happens per any message.
# each message has a bunch of attributes. Here are a few.
# check out more by print(dir(message)) for example.
print(f"{message.channel}: {message.author}: {message.author.name}: {message.content}")
client.run(token) # recall my token was saved!
@client.event
async def on_message(message): # event that happens per any message.
print(f"{message.channel}: {message.author}: {message.author.name}: {message.content}")
if str(message.author) == "hello" in message.content.lower():
await message.channel.send('hi')