我的代码:
import discord
from discord import commands
from discord import client
client = commands.Bot(command_prefix="!")
@client.event
async def on_ready():
print("Ready")
@client.command()
async def ping(ctx):
await ctx.send("Pong")
client.run("My_Token")
错误输出:
Traceback (most recent call last):
File "c:\Uers\ Username \Desktop\discordbot\bot.py", line 2, in <module>
from discord import commands
ImportError: cannot import name 'commands' from 'discord' (C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\__init__.py)
和
当我导入不和谐时:不和谐不被访问 Playnce(灰色)
我该如何解决这个问题?