telegram-bot

How do I get my Telegram bot to write in monospace?

How do I get my Telegram bot to write in monospace? Question: I am trying to write something in "monospace" with my telegram bot using the following Python function: @bot.message_handler(commands=[‘test_monospace’]) def test_monospace(message): bot.reply_to(message, "“`This message should be in monospace“`") Unfortunately, when I test the bot I get the message without the monospace formatting How can …

Total answers: 1

Runging own Telgram bot based on PTB 13x and local Telegram bot API behind nginx

Runging own Telgram bot based on PTB 13x and local Telegram bot API behind nginx Question: Try to use local Telegram bot API to take benefits of larger files for my bot serving and helping users in supergroup with files as described here Build stack with Telegram Bot API, nginx as reverse proxy and my …

Total answers: 1

MessageHandler not able to catch commands

MessageHandler not able to catch commands Question: we would like to monitor users who send commands to the bot, but when the bot is started, the messagehandler is able to catch messages and report that a private chat is started, but it seems that it can’t catch any of the three pre-defined commands(which are working …

Total answers: 1

How do I connect my telegram bot (telebot) to PostgreSQL url

How do I connect my telegram bot (telebot) to PostgreSQL url Question: I would like to learn how to connect my telegram bot to database url so that I store bot users, date of join and user information. Help me through that tutorial. How to connect a my telegram bot to PostgreSQL/database url. #code from …

Total answers: 1

Python Telegram bot doesn't start running at all

Python Telegram bot doesn't start running at all Question: I am a Python beginner trying to create a Telegram scheduler bot using the python-telegram-bot library and some code snippets I found online. However, when I try to run the code, the bot doesn’t seem to start running at all. I have double-checked that I am …

Total answers: 1

Subscribe mechanism in telegram bot

Subscribe mechanism in telegram bot Question: I’m trying to build a bot that basically has two threads. One thread is doing something, generating data and another thread is managing telegram bot. User can subscribe on telegram to receive updates from the first thread. This first thread calls the second one when it generates data and …

Total answers: 1

How to send some files with telegram bot in python

How to send some files with telegram bot in python Question: I’m trying to upload the outcomes of my code (they are images) in a group with a Telegram bot. I’ve tried: import requests import numpy as np paths=np.array([]) for z in range(8): paths=np.append(paths,str(f"path\{z}.jpg")) url="https://api.telegram.org/bot<<my-bot-http-token>>/senddocument?chat_id=<<chat-id>>" for path in paths: files={‘document’:open(path,’rb’)} resp=requests.post(url,files=files) It works but it …

Total answers: 1

I need a forward function code which forward the original message (pyrogram)

I need a forward function code which forward the original message (pyrogram) Question: @bot.on_message(filters.chat(INPUT_CHANNELS) & filters.text) def forward_message(client, message: Message): text = message.text client.send_message(chat_id=DESTINATION_CHANNEL, text=text) I got this code here, but it just forwards text from the message although there is an image. I need it to forward the original message, keeping all the content …

Total answers: 1

What am i doing wrong in python bot?

What am i doing wrong in python bot? Question: I don’t understand what is my mistake. Can someone show me the correct code My code: @dp.message_handler(content_types=[‘text’]) async def Text(update): dl = downloader.tiktok_downloader() global last_use meseg = update.message.text getvid = dl.musicaldown(url=meseg,output_name=’video.mp4′) if getvid: bot.send_video() return if getvid == False: getvid = dl.ttscraper(url=meseg, output_name="video.mp4") if getvid: bot.send_videoo() …

Total answers: 1