嘿,我在试着编辑一个电报机器人,但是这个错误不断出现:import telegram.ext ModuleNotFoundError: No module named 'telegram.ext'; 'telegram' is not a package。
我的代码是这样的:
import telegram.ext
with open('token.txt', 'r') as f:
TOKEN = f.read()
def start(update, context):
update.message.repl
当我试图运行我的脚本(我的电报机器人)时,终端中出现了以下内容:
/usr/local/lib/python3.7/dist-packages/python_telegram_bot-12.4.2-
py3.7.egg/telegram/utils/request.py:47: UserWarning: python-telegram-bot is using upstream urllib3.
This is allowed but not supported by python-telegram-bot maintainers.
我做了什么?
非常感谢
我使用Arch Linux。
我试图执行"pip install“来安装软件包,但无法做到:
❯ pip install python-telegram-bot
Defaulting to user installation because normal site-packages is not writeable
Collecting python-telegram-bot
Using cached python_telegram_bot-13.12-py3-none-any.whl (511 kB)
WARNING: Discarding https://files.pytho
我试图将一个简单的调用和响应机器人部署到Heroku,但我一直收到相同的错误,并且我不知道如何修复它。我发现这个程序可以在我的个人电脑上运行,但是当我把它部署到Heroku上时就不行了。我觉得这与我的import语句有关:
import random
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import MessageHandler
from telegram.ext import Filters
from telegram.ext import mes
嗨,谢谢你的回答。我想为我的频道创建一个转发消息的机器人,并每隔1分钟删除最后一条消息,但我在删除最后一条消息时遇到了一些问题。我无法从我的频道得到最后的信息id到机器人。
我的消息来源是:
from telegram.bot import Bot
from telegram.update import Update
from telegram.ext.updater import Updater
from telegram.ext.callbackcontext import CallbackContext
from telegram.ext.messagehandler import Me
我有一个非常简单的电报机器人,并希望发送一个自动信息给我的机器人用户每1小时,例如。问题是,当我运行celery -A main worker --loglevel=WARNING -B调度任务时,没有运行,但当我删除telegram_bot.runpolling()时,它的工作方式与预期完全相同。知道我能怎么解决这个问题吗?
import os
from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
print("Starting Ap
尝试从官方站点运行示例或电报机器人- 安装:
pip install python-telegram-bot
当我运行这个例子时,我得到了错误--这个版本是不兼容的。
if __version_info__ < (20, 0, 0, "alpha", 1):
raise RuntimeError(
f"This example is not compatible with your current PTB version {TG_VER}. To view the "
f"{TG_VER} version o
我正在尝试推送我的应用程序,几乎没有更改,只是添加了一个文件,该文件目前不涉及到应用程序中。昨天,这个应用运行得很好,但现在当我尝试推送新版本时,我得到了这个错误:
2020-02-29T15:26:39.875071+00:00 heroku[web.1]: State changed from crashed to starting
2020-02-29T15:26:43.028851+00:00 heroku[web.1]: Starting process with command `python costanti.py`
2020-02-29T15:26:44.744355+00:0
当我创建这个帖子时,我发现这个帖子在stackoverflow上没有任何回复…TelegramBot. "Webhook can be set up only on ports 80, 88, 443 or 8443" error on heroku webserver 我的测试代码如下: from configparser import ConfigParser
import logging
import os
import telegram
from flask import Flask, request
from telegram.ext import U
如何安装pip安装python-电传-bot中的pycharm。请帮我弄到这个错误信息-
$ : The term '$' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ $ pip install pyth
我是Python的新手,最近我试着用马克·鲍尔斯制造的机器人(.)来做。
很明显,它是用python-电-bot框架构建的。尽管设置它看起来很简单(附带说明),但我无法让它工作。
即使在我更新了一些代码以与框架的更改保持一致之后,现在我也得到了一个与与bot交互的用户一起显示的错误:0x7fcfa257f790函数错误。
目前的代码如下:
import configparser, threading, requests, json, re, time, sys
from uuid import uuid4
from telegram import InlineKeyboardButton,
每当我使用pip安装包时,我都会收到以下错误: Fatal error in launcher: Unable to create process using '"d:\python.exe" "D:\Scripts\pip.exe" install python-telegram-bot': Impossibile trovare il file specificato. 编辑:不可能的trovare il文件细节。表示无法找到指定的文件。我已经尝试重新安装了,但它不起作用。如何修复此错误?每个模块都会发生这种情况。