【发布时间】:2021-02-16 21:40:41
【问题描述】:
一直在尝试遵循有关不和谐机器人的教程,而我所看到的起始框架的每个地方都如下所示:
from imports import *
#link to manage bot
#establishes client for bot
client = commands.Bot(command_prefix = '.')
#create first event, readies the bot for use
@client.event
async def on_ready():
print("Bot ready to go")
#run bot from token, DO NOT SHARE TOKEN
client.run(token)
但是当我运行它时,它会立即崩溃。令牌是正确的,我确实 pip install discord.py,并且import discord 和from discord.ext import commands 都在其中。该机器人都在我的 Discord 上的服务器中,它只是不会出现在网上。请帮忙!
【问题讨论】:
-
crashes是什么意思?您是否收到任何错误或立即存在的应用程序? -
@KiraLT 只要我执行就会打开,然后立即退出。如果有的话,我不知道它抛出了什么错误。我尝试做
input(),但它仍然崩溃