Core: Check admin / user

Created on 14 Sep 2017  路  2Comments  路  Source: php-telegram-bot/core

I think these features will come in handy :)

if (isAdmin($user_id))
{
// Content for Admins
}
if (!isAdmin($user_id))
{
// Content for Users
}

I have 6 administrators of my bot. And to check the existence of everyone's rights is too cumbersome :D

Most helpful comment

It's already there.

public function Telegram::isAdmin($user_id = null) bool

Check if the passed user is an admin
If no user id is passed, the current update is checked for a valid message sender.

$this->getTelegram()->isAdmin();

All 2 comments

It's already there.

public function Telegram::isAdmin($user_id = null) bool

Check if the passed user is an admin
If no user id is passed, the current update is checked for a valid message sender.

$this->getTelegram()->isAdmin();

@chuv1 oh, thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

esomkin picture esomkin  路  3Comments

TheSleepySlee picture TheSleepySlee  路  3Comments

sineverba picture sineverba  路  3Comments

irmmr picture irmmr  路  3Comments

sayjeyhi picture sayjeyhi  路  3Comments