【发布时间】:2019-04-07 17:09:48
【问题描述】:
为什么我的代码会收到TypeError: 'module' object is not callable?
import discord
from discord.ext.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("Bot is online and connected to Discord")
@client.event
async def on_message(message):
if message.content == "cookie":
await client.send_message(message.channel, ":cookie:")
client.run("...")
完全错误:
错误:Client = discord.client() TypeError:“模块”对象不可调用
【问题讨论】:
-
您的标题看起来会引发错误,但您的示例看起来已修复。 github.com/Rapptz/discord.py/blob/async/discord/__init__.py#L20什么新问题?
标签: python discord.py