Posts

Showing posts with the label Telegram

Add User To Channel Automatically When User Asks

Answer : The bot ability is limited. It can only send and receive messages in a chat conversation and collect some information about other chat participants. It can not start a new conversation or other client functionality. For automate your task, you should use telegram API. There are some clients such as telegram-cli that use the telegram api and have high level methods. Other clients: tgl (C) kotlogram (Java) telethon (Python) webogram (Web) MadelineProto (PHP) TLSharp (C#) pytg (Python wrapper for telegram-cli) You can invite other users to your channel using: channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> = Updates; You can invite several uses at a time, via a list (Vector) of InputUser. This seems consistent with Telegram Desktop and the mobile clients, which allows you to select multiple contacts and add them to your group. InputUser is of the form: inputUser#d8292816 user_id:int access_hash:long = InputUser; ...

Can I Get A Phone Number By User Id Via Telegram Bot API?

Answer : No, unfortunately Telegram Bot API doesn't return phone number. You should either use Telegram API methods instead or ask it explicitly from the user. You cannot get "friends" of a user as well. You will definitely retrieve the following information: userid first_name content (whatever it is: text, photo, etc.) date (unixtime) chat_id If user configured it, you will also get last_name and username . It's possible with bots 2.0 check out bot api docs. https://core.telegram.org/bots/2-0-intro#locations-and-numbers https://core.telegram.org/bots/api#keyboardbutton