【问题标题】:how to solve client connector error in python?如何解决python中的客户端连接器错误?
【发布时间】: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


【解决方案1】:

我只是重新生成了令牌并且它起作用了

【讨论】:

    猜你喜欢
    • 2022-11-14
    • 2022-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-09
    • 1970-01-01
    相关资源
    最近更新 更多