【发布时间】:2021-03-01 18:16:23
【问题描述】:
我有下面的代码
我正在为不和谐写一个机器人
但我得到错误
“Exception has occurred: ClientConnectorError Cannot connect to host discord.com:443 ssl:default [The specified network name is no longer available]”
在最后一行
代码:
import discord
import os
client = discord.Client()
@client.event
async def ready1():
print('we have logged in')
@client.event
async def hello(message):
if message.author==client.user:
return
if message.content.contains('hello'):
await message.channel.send('hello')
client.run(token)
【问题讨论】:
-
您是否重新生成了令牌?你知道
client.event的正确名字吗? -
尝试重新生成令牌并将其放入您的代码中
标签: python discord discord.py bots python-module