module Tourmaline::Client::TDLightMethods

Direct including types

Defined in:

tourmaline/client/tdlight_methods.cr

Instance Method Summary

Instance Method Detail

def delete_messages(chat, start_id, end_id) #

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.


[View source]
def get_memory_stats #

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.


[View source]
def get_participants(chat) #

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.

[View source]
def login(phone_number) #

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.


[View source]
def optimize_memory #

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.


[View source]
def ping #

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.


[View source]
def register_user(first_name, last_name = nil) #

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.


[View source]
def send_code(code) #

Finish authenticating in "user mode" by providing the auth code that Telegram sent you.

!!! warning This is a tdlight only method. It will not work with the standard bot API.


[View source]