小编gap*_*nsi的帖子

如何使用python在telegram上发送照片

当我发出命令 /screen 时,我试图将计算机上的照片发送到我的电报机器人聊天室。但是,我似乎无法让它发挥作用,我错过了什么?

这是我正在使用的文件,抱歉它有点长,但我想展示所有内容,因为也许我在某个地方遗漏了一些东西。从 ###### HERE I WANNA TRY TO SEND THE PHOTO ###### 行查看,这样您就可以看到我在哪里定义 send_photo 部分。

import os
import bot
import schedule
import random
from time import sleep
import logging
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler

# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
                    level=logging.INFO)

logger = logging.getLogger(__name__)

# Define a few command handlers. These usually take the two arguments update and
# context. Error handlers also receive the raised TelegramError object in error.
def …
Run Code Online (Sandbox Code Playgroud)

python telegram python-telegram-bot telegram-bot

3
推荐指数
1
解决办法
5023
查看次数