B
B
bittenmuskrat2020-06-16 01:14:42
Python
bittenmuskrat, 2020-06-16 01:14:42

How to set a call barring command bot commands in a chat?

With the /start telegram command, the bot sends some information to the user.

This bot works in a group chat.
Issue: A user can send the /start command to a bot both in a private message and in a group chat.

How to make the bot register for the /start command only in private messages and ignore it when called in the general chat?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2020-06-16
@MrCute

You need to check message.chat.id. If it is less than zero, then it is a group. If more - then private chat.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question