Class: GrubY::TDLib::GroupManager
- Inherits:
-
Object
- Object
- GrubY::TDLib::GroupManager
- Defined in:
- lib/gruubY/tdlib/group_manager.rb
Instance Method Summary collapse
- #ban_chat_member(chat_id:, member_id:, banned_until_date: 0, revoke_messages: true) ⇒ Object
- #get_chat(chat_id:) ⇒ Object
- #get_chat_member(chat_id:, member_id:) ⇒ Object
-
#initialize(client) ⇒ GroupManager
constructor
A new instance of GroupManager.
- #leave_chat(chat_id:) ⇒ Object
- #pin_chat_message(chat_id:, message_id:, disable_notification: false) ⇒ Object
- #set_chat_description(chat_id:, description:) ⇒ Object
- #set_chat_title(chat_id:, title:) ⇒ Object
- #set_slow_mode(chat_id:, delay:) ⇒ Object
- #unban_chat_member(chat_id:, member_id:) ⇒ Object
- #unpin_chat_message(chat_id:, message_id: nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ GroupManager
Returns a new instance of GroupManager.
4 5 6 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#ban_chat_member(chat_id:, member_id:, banned_until_date: 0, revoke_messages: true) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 8 def ban_chat_member(chat_id:, member_id:, banned_until_date: 0, revoke_messages: true) @client.banChatMember( chat_id: chat_id, member_id: member_id, banned_until_date: banned_until_date, revoke_messages: ) end |
#get_chat(chat_id:) ⇒ Object
53 54 55 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 53 def get_chat(chat_id:) @client.getChat(chat_id: chat_id) end |
#get_chat_member(chat_id:, member_id:) ⇒ Object
49 50 51 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 49 def get_chat_member(chat_id:, member_id:) @client.getChatMember(chat_id: chat_id, member_id: member_id) end |
#leave_chat(chat_id:) ⇒ Object
45 46 47 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 45 def leave_chat(chat_id:) @client.leaveChat(chat_id: chat_id) end |
#pin_chat_message(chat_id:, message_id:, disable_notification: false) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 33 def (chat_id:, message_id:, disable_notification: false) @client.pinChatMessage( chat_id: chat_id, message_id: , disable_notification: disable_notification ) end |
#set_chat_description(chat_id:, description:) ⇒ Object
25 26 27 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 25 def set_chat_description(chat_id:, description:) @client.setChatDescription(chat_id: chat_id, description: description) end |
#set_chat_title(chat_id:, title:) ⇒ Object
21 22 23 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 21 def set_chat_title(chat_id:, title:) @client.setChatTitle(chat_id: chat_id, title: title) end |
#set_slow_mode(chat_id:, delay:) ⇒ Object
29 30 31 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 29 def set_slow_mode(chat_id:, delay:) @client.setChatSlowModeDelay(chat_id: chat_id, slow_mode_delay: delay) end |
#unban_chat_member(chat_id:, member_id:) ⇒ Object
17 18 19 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 17 def unban_chat_member(chat_id:, member_id:) @client.unbanChatMember(chat_id: chat_id, member_id: member_id) end |
#unpin_chat_message(chat_id:, message_id: nil) ⇒ Object
41 42 43 |
# File 'lib/gruubY/tdlib/group_manager.rb', line 41 def (chat_id:, message_id: nil) @client.unpinChatMessage(chat_id: chat_id, message_id: ) end |