module Tourmaline::Client::TDLightMethods
Direct including types
Defined in:
tourmaline/client/tdlight_methods.crInstance Method Summary
-
#delete_messages(chat, start_id, end_id)
Delete all messages from
start_id
toend_id
. -
#get_memory_stats
Return a JSON object containing the info about the memory manager, more info here.
-
#get_participants(chat)
Return a list of members in the given chat.
-
#login(phone_number)
Log in to the server in "user mode".
-
#optimize_memory
Remove old data from the in-memory cache and give the freed memory back to the os.
-
#ping
Send an MTProto ping message to the telegram servers.
-
#register_user(first_name, last_name = nil)
Register a user with Telegram.
-
#send_code(code)
Finish authenticating in "user mode" by providing the auth code that Telegram sent you.
Instance Method Detail
Delete all messages from start_id
to end_id
. start_id
must be less than end_id
and both must be positive, non-zero numbers.
!!! warning This is a tdlight only method. It will not work with the standard bot API. This method does not work in private chats or normal group. It is also not suggested to delete more than 200 messages per call.
Return a JSON object containing the info about the memory manager, more info here.
!!! warning This is a tdlight only method. It will not work with the standard bot API.
Return a list of members in the given chat. Raises [ChatNotFound][Tourmaline::Error::ChatNotFound] if your bot is not a member of the requested chat.
!!! warning This is a tdlight only method. It will not work with the standard bot API.
Additionally this request is __heavily__ rate limited by Telegram. Use sparingly.
Log in to the server in "user mode". This allows you to log in with your user account instead of a bot account.
!!! warning This is a tdlight only method. It will not work with the standard bot API.
Remove old data from the in-memory cache and give the freed memory back to the os. Returns true on success.
!!! warning This is a tdlight only method. It will not work with the standard bot API.
Send an MTProto ping message to the telegram servers. Useful to detect the delay of the bot api server. Returns the response time in milliseconds.
!!! warning This is a tdlight only method. It will not work with the standard bot API.
Register a user with Telegram. Must be called after #login
and #send_code
.
Returns true on success.
!!! warning This is a tdlight only method. It will not work with the standard bot API. Additionally, user registration is disabled by default in TDLight. To enable it please see the TDLight docs.