Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin mode #47

Closed
abrostamian opened this issue Feb 15, 2017 · 3 comments
Closed

Admin mode #47

abrostamian opened this issue Feb 15, 2017 · 3 comments

Comments

@abrostamian
Copy link

How check the user is admin and set some spetial manage to admins bot? And other user cant do that.
Just admin.
And how set user is admin?

@Eleirbag89
Copy link
Owner

Eleirbag89 commented Feb 16, 2017

If you want to check if a user is a channel admin you can use the getChatMember function which returns a ChatMember object with the status value of “creator”, “administrator”, “member”, “left” or “kicked”.
For stand alone bot you can hardcode the user_id in the if condition of a command.
Es

if ($text == "/adminCommand" && data["message"]["from"]["id"] == "admin_user_id") {
//do stuff
}

Of course you can save the admins user_id list in a file/database

@abrostamian
Copy link
Author

no i want check the user is a bot admin to do some work.

@Eleirbag89
Copy link
Owner

Eleirbag89 commented Feb 17, 2017

Telegram's bots don't have the concept of "bot admin" so you need to implement it yourself.
You can follow the way i proposed in the second part of my previous comment or think another work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants