telegram-bot

How to get voice file in python-telegram-bot

How to get voice file in python-telegram-bot Question: Im using python-telegram-bot im trying to get voice file from user in chat, but im getting error error: RuntimeWarning: coroutine ‘ExtBot.get_file’ was never awaited return await self.callback(update, context) RuntimeWarning: Enable tracemalloc to get the object allocation traceback and this is my codes: async def get_voice(update: Update, context: …

Total answers: 1

how to specify if the message was from group or private in python telegram bot

how to specify if the message was from group or private in python telegram bot Question: Here is my code: # 1st method if chat.type == ‘supergroup’: # Check if the bot’s name was mentioned in the message # if bot_name in message_text: # Generate a response to the question response_text = generate_response(message_text) update.message.reply_text(response_text) elif …

Total answers: 2

Where are secrets kept in Telegram Bots?

Where are secrets kept in Telegram Bots? Question: I’m developing a Telegram Bot which will make HTTP request to an external API which requires an API key. Is there a special place wherein secrets like this should be kept in Telegram Bots? The one that Telegram API or SDK may provide? Or is it normal …

Total answers: 1

How to check user is admin or not in python-telegram-bot?

How to check user is admin or not in python-telegram-bot? Question: Im using python-telegram-bot I want to check if the user in the group is an admin or not, if the user is an admin he can use the commands and if the user is not an admin, he will receive a message saying that …

Total answers: 1

How to Reply Message in Unknown ChatBot Telegram with Python?

How to Reply Message in Unknown ChatBot Telegram with Python? Question: I have a ChatBot in Telegram that forwards message from others to me and I can reply their messages by replying messages in bot. When I reply a message, the bot checks that message user id, and send my message to that id. But …

Total answers: 1

How to get a telegram bot work in a channel?

How to get a telegram bot work in a channel? Question: I can’t get it to work through properties like command or just content_types. No errors show up. @dp.message_handler(commands=["start"]) async def start(msg:Message): if msg.chat.type == ChatType.CHANNEL: await msg.answer(msg) I made so bot sent a message to the channel. Still nothing. P.S It works with getUpdates …

Total answers: 1

how to add a userbot to a group by link? python telegram api

how to add a userbot to a group by link? python telegram api Question: I get a link with which I need to add the bot to a group (private or public) I did not find anything that could help me my code: link = ‘https://t.me/+r….’ client = TelegramClient(session=’joiner’, api_id=api_id, api_hash=api_hash) #login process result = …

Total answers: 1

telegram bot reply message for buttons

telegram bot reply message for buttons Question: recently i created a telegram bot using python and i added keyboard button features to the bot. However, i am having difficulties in getting replies from bot to the buttons users choose. button7 = KeyboardButton(‘About Us’,request_contact= False) keyboard2 = ReplyKeyboardMarkup(resize_keyboard = True, one_time_keyboard = True).row(button7) @dp.message_handler(commands=[‘info’]) async def …

Total answers: 1