python - 如何解决 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')
解决方案
推荐阅读
- python - 如何使用 Python 执行终端命令
- python - Pinecsript 到 Python 的转换
- r - 如何将月份和日期没有前导零的字符转换为日期?
- python - 使用 Python 从 BAM 文件和 vcf 文件中提取具有不同位置的读取和配对(PYSAM 和 PYSAM,也可以使用 bamnostics)
- c - C递归函数不可能?
- java - 如何将动作侦听器添加到静态 Jbutton?
- json - 试图将 GSON 中的 String jSON 数据解析为具有 String 值的枚举类。收到 BEGIN_OBJECT 而不是 String 的错误
- math - 您如何找到二维中两个三角形之间的交点/重叠的中心点?
- python - 循环更改大列表中的元素(一次 6 个)并为每次迭代创建一个新变量
- python - Python 多处理非常慢