Core: Deny BOT interactions with groups

Created on 24 Jun 2017  路  8Comments  路  Source: php-telegram-bot/core

Required Information

  • Operating system: Ubuntu server
  • PHP version: 7.1
  • PHP Telegram Bot version: 0.44.1
  • Using MySQL database: yes
  • MySQL version: I don't remember, we don't need it
  • Update Method: Webhook
  • Self-signed certificate: no
  • RAW update (if available): nope

Expected behaviour


If the bot is added to a group it shouldn't be able to interact to commands and messages but it should be able to send messages.
(Users cannot use bot commands etc.)
The button which lists the commands should not appear.

Actual behaviour


Users can run bot commands and interact with it, they will see the commands list button

Steps to reproduce


Create a bot, add it to a group, use it.

Is there any way to blind it when in a group?

Most helpful comment

image
Or, you could just disable group support for bot via BotFather...

All 8 comments

You mean something like this? #527

Not really, I just want it to be restricted in groups
@noplanman

I could exit if the ID is set and is negative

Yes, that would be an option 馃憤

That will block access completely, even to admins and system commands, just so you know!

There is an open ticket to implement this in the Manager here:
https://github.com/php-telegram-bot/telegram-bot-manager/issues/33

Thanks this solved my problem

A better option might be to make use of the message->chat->type data:

$POST_DATA['message']['chat']['type'];

Which can be private, group, supergroup and channel. So you can limit more finely if required.

Awesome! I guess I'm going to use the type

image
Or, you could just disable group support for bot via BotFather...

The problem is that I need it in a group but users shouldn't use it so I'll
stick with the type check :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noplanman picture noplanman  路  3Comments

mohsenshahab picture mohsenshahab  路  4Comments

dorcu picture dorcu  路  3Comments

TheSleepySlee picture TheSleepySlee  路  3Comments

tchibomann picture tchibomann  路  3Comments