首页 > 解决方案 > 如何解决 aiohttp 或 aiogram 的问题?

问题描述

aiogram.utils.exceptions.NetworkError:Aiohttp 客户端抛出错误:ClientConnectorError:无法连接到主机 api.telegram.org:443 ssl:默认 [超过信号量超时] 我在运行电报机器人的代码时遇到此错误。然后,我再次安装了 aiohttp。它已经消失了。但这里还有另一个问题。当我运行电报机器人的代码时,机器人不工作。他没有回答我的命令,但控制台没有错误。没有错误 - 但机器人不起作用。
有人可以帮我解决这个问题吗?我感谢任何建议和提示。Python-3.8v

代码:

from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
import time
from time import sleep
import selenium
from selenium import webdriver
import asyncio
bot = Bot('token')
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def start_message(message):
    await bot.send_message(message.chat.id, 'some text')

标签: pythonpython-3.xaiohttppytest-aiohttp

解决方案


推荐阅读