Telegram Bot - permission levels for commands - telegram

I'm new in Telegram Bot. There is way to setup permission level for only some commands?
I mean, instead of only "Admin" and "User" levels, have a "User+" role that has access to extra commands in the bot chat than stardard Users.
Thanks for help.

Related

How to send a Telegram message to a username using bot api or telegram api?

Hi I am trying to build a website login system where users are able to log in using their telegram. I would like to achieve this workflow:
User selects to login/sign up via telegram.
User enters their username (#ExampleJoe).
A 6-digit verification code is sent to them via my Telegram bot (#ExampleBot).
The user enters the received 6-digit code into my website and is allowed to enter.
I have issues with steps 2-3 where my bot can send them a direct message (not in a group chat) with only their username. I am aware that sendMessage method in the Telegram bot API requires a chat_id and that a user_id is also suitable. However, I do not know how to get the user_id with just the user's username.
That's not possible with the Bot API. You'd have to use a userbot for that. Note however, that TG provides a native login widget that you can use instead.

How do you grant a user access to create webhooks in Phabricator?

I know that webhooks are available in Herald > Webhooks in Phabricator, but I can't figure out how to grant access to this function. When I click the button I see the message: You do not have permission to create these objects.
Does anyone know how to grant access to create webhooks?
You can promote an user from standard user to Administrator to grant access to Phabricator webhooks.
Users must have the "Can Create Webhooks" permission to create new
webhooks.
― Phabricator Webhooks documentation
If you need further customization, visit this URL and change the default:
http://example.com/applications/view/PhabricatorHeraldApplication/

Is it possible for a telegram bot that is an “admin” of a channel to make a user of a channel an admin?

I have a telegram bot that asks a channel user a certain set of questions. Based on these answers, I would like that user to automatically become the admin of the telegram channel. Is that possible?
Yes.
Bots can promote users using the method promoteChatMember. You can also select which privilege the user should have.
Use this method to promote or demote a user in a supergroup or a
channel. The bot must be an administrator in the chat for this to work
and must have the appropriate admin rights. Pass False for all boolean
parameters to demote a user. Returns True on success.
Check the documentation to find all the details for its usage.

Firebase - Edit other user data

I'm trying to edit email address and password for other user via code. Is this possible to do without Admin SDK? I'm asking because I dont have backend skills yet. Does Firebase have a method to login user via uid? Maybe this way I will made my goal?
Users can only update their own data in mobile apps using the Auth client SDKs. It would be a gigantic security hole if any user could modify or log in as any other user without credentials.

As a telegram bot, what is the best way to authenticate the owner of a telegram channel?

Is there a way for a telegram bot to know who is the administrator of a channel?
One way to do this is to send a verification code to channel admin and ask the admin to confirm the code. I couldnt find any API that allows sending a message to channel admin, though.
I can authenticate a user account just by asking user to send a message to my bot, but is there a way to have a channel sending a message to a bot?
i think this is not required!
when you have a1255412542_bot and ask the user to add this bot as administrator, is it possible to a channel admin to add this bot as admin?!!
you can:
ask the channel name,
send a message to the channel to ensure that the bot is not the admin of the channel,
ask the user to add your bot as admin immediately! then press ok button on your bot,
then you send a text message (or sendChatAction for hidden test) to the channel and if successful, finished!
You can get the list of admins of any channel using this method:
https://core.telegram.org/bots/api#getchatadministrators
Check the permissions of that user since it returns a json array of username of the admins and their permissions

Resources