Class: MaxApiClient::ChatsApi
- Inherits:
-
BaseApi
- Object
- BaseApi
- MaxApiClient::ChatsApi
show all
- Defined in:
- lib/max_api_client/raw_api.rb,
sig/max_api_client.rbs
Overview
Raw chat management endpoints.
Constant Summary
Constants inherited
from BaseApi
BaseApi::HTTP_METHODS
Instance Method Summary
collapse
Methods inherited from BaseApi
#initialize
Instance Method Details
#add_chat_members(chat_id:, user_ids:) ⇒ Object
74
75
76
|
# File 'lib/max_api_client/raw_api.rb', line 74
def add_chat_members(chat_id:, user_ids:)
post("chats/{chat_id}/members", path_params: { chat_id: }, body: { user_ids: })
end
|
#edit(chat_id:, **extra) ⇒ Object
62
63
64
|
# File 'lib/max_api_client/raw_api.rb', line 62
def edit(chat_id:, **)
patch("chats/{chat_id}", path_params: { chat_id: }, body: )
end
|
#get_all(**extra) ⇒ Object
50
51
52
|
# File 'lib/max_api_client/raw_api.rb', line 50
def get_all(**)
get("chats", query: )
end
|
#get_by_id(chat_id:) ⇒ Object
54
55
56
|
# File 'lib/max_api_client/raw_api.rb', line 54
def get_by_id(chat_id:)
get("chats/{chat_id}", path_params: { chat_id: })
end
|
#get_by_link(chat_link:) ⇒ Object
58
59
60
|
# File 'lib/max_api_client/raw_api.rb', line 58
def get_by_link(chat_link:)
get("chats/{chat_link}", path_params: { chat_link: })
end
|
#get_chat_admins(chat_id:) ⇒ Object
70
71
72
|
# File 'lib/max_api_client/raw_api.rb', line 70
def get_chat_admins(chat_id:)
get("chats/{chat_id}/members/admins", path_params: { chat_id: })
end
|
#get_chat_members(chat_id:, **query) ⇒ Object
78
79
80
|
# File 'lib/max_api_client/raw_api.rb', line 78
def get_chat_members(chat_id:, **query)
get("chats/{chat_id}/members", path_params: { chat_id: }, query:)
end
|
#get_chat_membership(chat_id:) ⇒ Object
66
67
68
|
# File 'lib/max_api_client/raw_api.rb', line 66
def get_chat_membership(chat_id:)
get("chats/{chat_id}/members/me", path_params: { chat_id: })
end
|
#get_pinned_message(chat_id:) ⇒ Object
86
87
88
|
# File 'lib/max_api_client/raw_api.rb', line 86
def get_pinned_message(chat_id:)
get("chats/{chat_id}/pin", path_params: { chat_id: })
end
|
#leave_chat(chat_id:) ⇒ Object
102
103
104
|
# File 'lib/max_api_client/raw_api.rb', line 102
def leave_chat(chat_id:)
delete("chats/{chat_id}/members/me", path_params: { chat_id: })
end
|
#pin_message(chat_id:, message_id:, notify: nil) ⇒ Object
90
91
92
|
# File 'lib/max_api_client/raw_api.rb', line 90
def pin_message(chat_id:, message_id:, notify: nil)
put("chats/{chat_id}/pin", path_params: { chat_id: }, body: compact_nil(message_id:, notify:))
end
|
#remove_chat_member(chat_id:, user_id:, block: nil) ⇒ Object
82
83
84
|
# File 'lib/max_api_client/raw_api.rb', line 82
def remove_chat_member(chat_id:, user_id:, block: nil)
delete("chats/{chat_id}/members", path_params: { chat_id: }, body: compact_nil(user_id:, block:))
end
|
#send_action(chat_id:, action:) ⇒ Object
98
99
100
|
# File 'lib/max_api_client/raw_api.rb', line 98
def send_action(chat_id:, action:)
post("chats/{chat_id}/actions", path_params: { chat_id: }, body: { action: })
end
|
#unpin_message(chat_id:) ⇒ Object
94
95
96
|
# File 'lib/max_api_client/raw_api.rb', line 94
def unpin_message(chat_id:)
delete("chats/{chat_id}/pin", path_params: { chat_id: })
end
|