【发布时间】:2019-03-12 01:16:19
【问题描述】:
我目前正在开发一个用 Python 编程语言编写的 Discord 机器人。我看过一些教程,因为我自己无法让它工作,我注意到所有人都使用了 Client = discord.Client() 导入运行程序所需的文件后的命令。当我尝试运行该应用程序时,它说
Traceback (most recent call last):
File "C:\Users\Admin\Desktop\testbot.py", line 2, in <module>
import discord.client
ModuleNotFoundError: No module named 'discord.client'
如果有人有任何建议,请回复并告诉我! 谢谢!
这是我的机器人代码!
import discord
Client = discord.Client()
@client.event
async def on_ready():
print ("Bot is ready!")
@client.event
async def on_message(message):
if message.content == '/testconnection':
await client.send_message(message.channel, "Connection successfully established with Discord NET")
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('-------')
client.run("my discord bot token goes here but i'm hiding it ")
【问题讨论】:
标签: python bots discord discord.py