Category : telegram-bot

I have attached the code. I want chat_id to be accessed from the text file located at my local machine. #constants.py chatid_list = [] file1 = open(r’D:folder1chatids.txt’, "r") for chat_id in file1: chatid_list.append(chat_id) #main.py def start(update, context): chat_id = update.message.chat_id first_name =update.message.chat.first_name last_name = update.message.chat.last_name username = update.message.chat.username if chat_id in cp.chatid_list: print("chat_id : {} ..

Read more

import telegram from telegram.ext import Updater, MessageHandler, Filters from bs4 import BeautifulSoup from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from requests.exceptions import RequestException, ConnectionError, HTTPError, URLRequired, Timeout, TooManyRedirects token = "" bot = telegram.Bot(token) updater = Updater(token=token) dispatcher = updater.dispatcher updater.start_polling() exceptions = (RequestException, ConnectionError, HTTPError, URLRequired, Timeout, TooManyRedirects) def handler(update, context): try: text ..

Read more

am trying to do a telegram bot which shows to the user the popular movies upon sending [‘pm’]. But, I couldn’t get the right message from the bot. Here is my code: import os import telebot from dotenv import load_dotenv import movies load_dotenv() API_KEYS = os.getenv("API_KEYS") bot = telebot.TeleBot(API_KEYS) pMovies = movies.mPopular @bot.message_handler(commands=[‘Greet’]) def greet(message): ..

Read more