Posts

Showing posts with the label telegram-bot

Telegram Bot Clickable Command with Parameters

Image
Telegram Bot Clickable Command with Parameters I am using python-telegram-bot to create a Telegram bot. I am trying to insert a command with parameters into bot messages, such that a user could press it? Here, on telegram core page I found a pic that depics a chat with command + parameters (/dl_) However I cannot get how this can be done 2 Answers 2 Check out this closed issue: https://github.com/python-telegram-bot/python-telegram-bot/issues/696 The concept is pretty simple: /dl_ Quick working solution for you: #!/usr/bin/python3 from telegram.ext import Updater, MessageHandler, Filters from telegram.ext import RegexHandler from string import ascii_lowercase from string import digits from random import choice from sys import exc_info as error token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' def start(bot, update): username = update.message.from_user.first_name update.message....