from telegram import *
from telegram.ext import *
import requests
import os
def filter(self, update: Update, contex: CallbackContext):
user_msg = Chat(id=update.effective_chat.id)
print(user_msg)
# user_msg = update.message.text
#
# text_list = os.linesep.join([s for s in str(user_msg).splitlines() if s])
# self.post(str(text_list).replace('#', '%23'))
def post(self, text):
url = f'https://api.telegram.org/bot{self.token}/sendMessage?chat_id={self.destination_id}&text={text}'
return requests.get(url).status_code == 200
def start(self):
self.dispatcher.add_handler(MessageHandler(None, self.filter))
self.updater.start_polling()
我想阅读私人频道的文字,但现在显示文字。