-2

I have webhook a telegram bot for search data my a hosted How can ignore positive chat I'd by bot I have a bot to search files from my hosted data And get link using telegram I want that bot just work in groups only If any person try to use it in personal chat it will not give reply means not search data and not give a link

2 Answers2

0

Every message has a chat field and each chat has a type see telegram bot api

Type of chat, can be either “private”, “group”, “supergroup” or “channel”

check if type of chat of message is equal to “group” or “supergroup” then do what you want.

In php can check like below

if($message->chat->type == "group")
  ...
Community
  • 1
  • 1
amin saffar
  • 1,953
  • 3
  • 22
  • 34
-1

Can you clear before using this command if($message->chat->type == "group") Need other commands in header Or full command please