Python不协调bot错误
我正在用python制作一个discord机器人 在输出中,它说我有4个错误 我不明白为什么 我已经安装了discord.py,并且正在使用Python 3.5 你知道发生了什么事吗 错误:Python不协调bot错误,python,discord,discord.py,Python,Discord,Discord.py,我正在用python制作一个discord机器人 在输出中,它说我有4个错误 我不明白为什么 我已经安装了discord.py,并且正在使用Python 3.5 你知道发生了什么事吗 错误: E0611:No name 'exe' in module 'discord' E0602:Undefined variable 'message' E0401:Unable to import 'discord.exe.commands' E0602:Undefined variable
E0611:No name 'exe' in module 'discord'
E0602:Undefined variable 'message'
E0401:Unable to import 'discord.exe.commands'
E0602:Undefined variable 'message'
代码:
第一个错误:您导入了
discord.exe
;它的名字叫discord.ext
第二个错误:您在
on_message
声明中将message
参数分配给了namemaker
。将其更改为on_message(message)
以获取变量第一个错误:您导入了discord.exe
;它的名字叫discord.ext
第二个错误:您在on_message
声明中将message
参数分配给了namemaker
。将其更改为消息(message)上的,以获取变量
import discord
from discord.exe.commands import Bot
from discord.ext import commands
import asyncio
import time
Client = discord.Client()
client = commands.Bot(command_prefix = ";")
@client.event
async def on_ready():
print("The bot is sailing on the seven seas")
@client.event
async def on_message(maker):
if message.content == "cookie":
await client.send_message(message.channel, ":cookie:")
client.run("1NDE2--CHANGED--L24CMo"))