Answer the question
In order to leave comments, you need to log in
How to write a telegram bot with commands through /?
How to make a bot with commands through / ?
I learned how to do with Inline and Reply button, but I need it to look like in this example, without buttons at all, but with commands like this. And so that these commands do not come up in the list. Just to poke and open something further.
Here is the beginning of the code, what's next?
import telebot;
import random;
from telebot import types;
bot = telebot.TeleBot('******************************')
@bot.message_handler(content_types=['text'])
def get_text_messages(message):
bot.send_message(message.from_user.id, f" Добро пожаловать.")
Answer the question
In order to leave comments, you need to log in
@bot.message_handler(content_types=['text'])
Change
this to
@bot.message_handler(commands=[' Your command '])
And everything with a slash will work
FatherBot has documentation,
everything is described here https://core.telegram.org/bots
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question