yaylib 1.2.2__tar.gz → 1.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {yaylib-1.2.2/yaylib.egg-info → yaylib-1.2.3}/PKG-INFO +13 -15
  2. {yaylib-1.2.2 → yaylib-1.2.3}/README.md +12 -14
  3. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/api.py +6 -6
  4. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/call.py +19 -19
  5. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/cassandra.py +3 -3
  6. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/chat.py +27 -27
  7. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/group.py +41 -41
  8. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/login.py +11 -13
  9. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/misc.py +14 -14
  10. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/post.py +54 -54
  11. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/review.py +7 -7
  12. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/thread.py +10 -10
  13. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/user.py +46 -46
  14. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/client.py +520 -377
  15. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/config.py +4 -5
  16. {yaylib-1.2.2 → yaylib-1.2.3/yaylib.egg-info}/PKG-INFO +13 -15
  17. {yaylib-1.2.2 → yaylib-1.2.3}/LICENSE +0 -0
  18. {yaylib-1.2.2 → yaylib-1.2.3}/setup.cfg +0 -0
  19. {yaylib-1.2.2 → yaylib-1.2.3}/setup.py +0 -0
  20. {yaylib-1.2.2 → yaylib-1.2.3}/tests/__init__.py +0 -0
  21. {yaylib-1.2.2 → yaylib-1.2.3}/tests/config.py +0 -0
  22. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_call.py +0 -0
  23. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_cassandra.py +0 -0
  24. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_chat.py +0 -0
  25. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_group.py +0 -0
  26. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_misc.py +0 -0
  27. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_post.py +0 -0
  28. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_review.py +0 -0
  29. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_thread.py +0 -0
  30. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_user.py +0 -0
  31. {yaylib-1.2.2 → yaylib-1.2.3}/tests/test_utils.py +0 -0
  32. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/__init__.py +0 -0
  33. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/__init__.py +0 -0
  34. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/api/websocket.py +0 -0
  35. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/errors.py +0 -0
  36. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/models.py +0 -0
  37. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/responses.py +0 -0
  38. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib/utils.py +0 -0
  39. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib.egg-info/SOURCES.txt +0 -0
  40. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib.egg-info/dependency_links.txt +0 -0
  41. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib.egg-info/requires.txt +0 -0
  42. {yaylib-1.2.2 → yaylib-1.2.3}/yaylib.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yaylib
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: 同世代と趣味の通話コミュニティ - Yay! (イェイ) で投稿やタイムラインの取得、リツイートやいいねの実行、フォローや投稿の検索など様々な機能をPythonプログラムから利用可能なAPIクライアントツールです。
5
5
  Home-page: https://github.com/qvco/yaylib
6
6
  Download-URL: https://github.com/qvco/yaylib
@@ -35,8 +35,8 @@ License-File: LICENSE
35
35
  あらゆる操作の自動化や、ボットの開発が可能です。
36
36
  <br />
37
37
  <br />
38
- <a href="https://github.com/qvco/yaylib/blob/master/docs/README.md">
39
- <strong>ドキュメントはこちらから »</strong>
38
+ <a href="https://github.com/qvco/yay.js">
39
+ <strong>Node.js 版はこちらから (推奨) »</strong>
40
40
  </a>
41
41
  <br />
42
42
  <br />
@@ -53,16 +53,25 @@ License-File: LICENSE
53
53
  <details>
54
54
  <summary>Table of Contents</summary>
55
55
  <ol>
56
+ <li><a href="#buy-me-a-coffee">Buy me a coffee</a></li>
56
57
  <li><a href="#-installation">インストール</a></li>
57
58
  <li><a href="#-quick-example">使用例</a></li>
58
59
  <li><a href="#crown-yaylib-で誕生したロボットたち">yaylib で誕生したロボットたち</a></li>
59
60
  <li><a href="#handshake-共同開発について">共同開発について</a></li>
60
- <li><a href="#buy-me-a-coffee">Buy me a coffee</a></li>
61
61
  <li><a href="#免責事項">免責事項</a></li>
62
62
  <li><a href="#利用許諾">利用許諾</a></li>
63
63
  </ol>
64
64
  </details>
65
65
 
66
+ <!-- Buy me a coffee -->
67
+
68
+ ## Buy me a coffee
69
+
70
+ このライブラリが気に入っていただけたら、<a href="https://github.com/qvco/yaylib/">**リポジトリにスターをお願いします</a>(⭐)**
71
+ また、Buy Me a Coffee からご支援いただけますと幸いです。
72
+
73
+ <a href="https://www.buymeacoffee.com/qvco" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
74
+
66
75
  <!-- インストール -->
67
76
 
68
77
  ## [<img src="https://github.com/qvco/yaylib/assets/77382767/2f632349-0cbc-4c81-bc19-11d24c8c142b" width="30" height="30" />](https://github.com/qvco) Installation
@@ -90,8 +99,6 @@ pip install -r requirements.txt
90
99
  pip install -e .
91
100
  ```
92
101
 
93
- 「yaylib」の始め方については、[こちら](https://github.com/qvco/yaylib/blob/master/docs/TUTORIAL.md) を確認してください。
94
-
95
102
  <!-- 使用例 -->
96
103
 
97
104
  ## [<img src="https://github.com/qvco/yaylib/assets/77382767/dc7dcea0-c581-4039-8fc2-3994884d2ba3" width="30" height="30" />](https://github.com/qvco) Quick Example
@@ -284,15 +291,6 @@ bot.run(ws_token)
284
291
 
285
292
  のいずれかの方法で繋がりましょう。詳しくは[こちらから](https://github.com/qvco/yaylib/blob/master/CONTRIBUTING.md)!
286
293
 
287
- <!-- Buy me a coffee -->
288
-
289
- ## Buy me a coffee
290
-
291
- このライブラリが気に入っていただけたら、<a href="https://github.com/qvco/yaylib/">**リポジトリにスターをお願いします</a>(⭐)**
292
- また、Buy Me a Coffee からご支援いただけますと幸いです。
293
-
294
- <a href="https://www.buymeacoffee.com/qvco" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
295
-
296
294
  <!-- 免責事項 -->
297
295
 
298
296
  ## 免責事項
@@ -16,8 +16,8 @@
16
16
  あらゆる操作の自動化や、ボットの開発が可能です。
17
17
  <br />
18
18
  <br />
19
- <a href="https://github.com/qvco/yaylib/blob/master/docs/README.md">
20
- <strong>ドキュメントはこちらから »</strong>
19
+ <a href="https://github.com/qvco/yay.js">
20
+ <strong>Node.js 版はこちらから (推奨) »</strong>
21
21
  </a>
22
22
  <br />
23
23
  <br />
@@ -34,16 +34,25 @@
34
34
  <details>
35
35
  <summary>Table of Contents</summary>
36
36
  <ol>
37
+ <li><a href="#buy-me-a-coffee">Buy me a coffee</a></li>
37
38
  <li><a href="#-installation">インストール</a></li>
38
39
  <li><a href="#-quick-example">使用例</a></li>
39
40
  <li><a href="#crown-yaylib-で誕生したロボットたち">yaylib で誕生したロボットたち</a></li>
40
41
  <li><a href="#handshake-共同開発について">共同開発について</a></li>
41
- <li><a href="#buy-me-a-coffee">Buy me a coffee</a></li>
42
42
  <li><a href="#免責事項">免責事項</a></li>
43
43
  <li><a href="#利用許諾">利用許諾</a></li>
44
44
  </ol>
45
45
  </details>
46
46
 
47
+ <!-- Buy me a coffee -->
48
+
49
+ ## Buy me a coffee
50
+
51
+ このライブラリが気に入っていただけたら、<a href="https://github.com/qvco/yaylib/">**リポジトリにスターをお願いします</a>(⭐)**
52
+ また、Buy Me a Coffee からご支援いただけますと幸いです。
53
+
54
+ <a href="https://www.buymeacoffee.com/qvco" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
55
+
47
56
  <!-- インストール -->
48
57
 
49
58
  ## [<img src="https://github.com/qvco/yaylib/assets/77382767/2f632349-0cbc-4c81-bc19-11d24c8c142b" width="30" height="30" />](https://github.com/qvco) Installation
@@ -71,8 +80,6 @@ pip install -r requirements.txt
71
80
  pip install -e .
72
81
  ```
73
82
 
74
- 「yaylib」の始め方については、[こちら](https://github.com/qvco/yaylib/blob/master/docs/TUTORIAL.md) を確認してください。
75
-
76
83
  <!-- 使用例 -->
77
84
 
78
85
  ## [<img src="https://github.com/qvco/yaylib/assets/77382767/dc7dcea0-c581-4039-8fc2-3994884d2ba3" width="30" height="30" />](https://github.com/qvco) Quick Example
@@ -265,15 +272,6 @@ bot.run(ws_token)
265
272
 
266
273
  のいずれかの方法で繋がりましょう。詳しくは[こちらから](https://github.com/qvco/yaylib/blob/master/CONTRIBUTING.md)!
267
274
 
268
- <!-- Buy me a coffee -->
269
-
270
- ## Buy me a coffee
271
-
272
- このライブラリが気に入っていただけたら、<a href="https://github.com/qvco/yaylib/">**リポジトリにスターをお願いします</a>(⭐)**
273
- また、Buy Me a Coffee からご支援いただけますと幸いです。
274
-
275
- <a href="https://www.buymeacoffee.com/qvco" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
276
-
277
275
  <!-- 免責事項 -->
278
276
 
279
277
  ## 免責事項
@@ -134,7 +134,7 @@ class API:
134
134
  response = get_timestamp(self)
135
135
  self.session.headers.update({"X-Client-IP": response.ip_address})
136
136
 
137
- def _request(
137
+ def _make_request(
138
138
  self,
139
139
  method,
140
140
  endpoint,
@@ -291,9 +291,7 @@ class API:
291
291
  }
292
292
  )
293
293
 
294
- # copy the cookies to ensure its value remains unchanged during encryption
295
- cookies = self.cookies.copy()
296
- self.save_cookies(cookies)
294
+ self.save_cookies(self.cookies)
297
295
 
298
296
  # only for the next retry
299
297
  headers["Authorization"] = "Bearer " + response.access_token
@@ -343,7 +341,7 @@ class API:
343
341
  else:
344
342
  return response
345
343
 
346
- def _make_request(
344
+ def request(
347
345
  self,
348
346
  method: str,
349
347
  endpoint: str,
@@ -356,7 +354,7 @@ class API:
356
354
  bypass_delay=False,
357
355
  access_token=None,
358
356
  ):
359
- response = self._request(
357
+ response = self._make_request(
360
358
  method,
361
359
  endpoint,
362
360
  params,
@@ -524,6 +522,8 @@ class API:
524
522
  return loaded_cookies
525
523
 
526
524
  def save_cookies(self, cookies):
525
+ cookies = cookies.copy()
526
+
527
527
  email = cookies.get("user", {}).get("email")
528
528
  if email is not None:
529
529
  cookies["user"]["email"] = hashlib.sha256(email.encode()).hexdigest()
@@ -44,7 +44,7 @@ def bump_call(
44
44
  params = {}
45
45
  if participant_limit:
46
46
  params["participant_limit"] = participant_limit
47
- response = self._make_request(
47
+ response = self.request(
48
48
  "POST",
49
49
  endpoint=f"{Endpoints.CALLS_V1}/{call_id}/bump",
50
50
  params=params,
@@ -55,7 +55,7 @@ def bump_call(
55
55
 
56
56
 
57
57
  def get_user_active_call(self, user_id: int, access_token: str = None) -> Post:
58
- return self._make_request(
58
+ return self.request(
59
59
  "GET",
60
60
  endpoint=f"{Endpoints.POSTS_V1}/active_call",
61
61
  params={"user_id": user_id},
@@ -65,7 +65,7 @@ def get_user_active_call(self, user_id: int, access_token: str = None) -> Post:
65
65
 
66
66
 
67
67
  def get_bgms(self, access_token: str = None) -> list[Bgm]:
68
- return self._make_request(
68
+ return self.request(
69
69
  "GET",
70
70
  endpoint=f"{Endpoints.CALLS_V1}/bgm",
71
71
  data_type=BgmsResponse,
@@ -74,7 +74,7 @@ def get_bgms(self, access_token: str = None) -> list[Bgm]:
74
74
 
75
75
 
76
76
  def get_call(self, call_id: int, access_token: str = None) -> ConferenceCall:
77
- return self._make_request(
77
+ return self.request(
78
78
  "GET",
79
79
  endpoint=f"{Endpoints.CALLS_V1}/conferences/{call_id}",
80
80
  data_type=ConferenceCallResponse,
@@ -89,7 +89,7 @@ def get_call_invitable_users(
89
89
  params = {}
90
90
  if from_timestamp:
91
91
  params["from_timestamp"] = from_timestamp
92
- return self._make_request(
92
+ return self.request(
93
93
  "GET",
94
94
  endpoint=f"{Endpoints.CALLS_V1}/{call_id}/users/invitable",
95
95
  params=params,
@@ -101,7 +101,7 @@ def get_call_invitable_users(
101
101
  def get_call_status(
102
102
  self, opponent_id: int, access_token: str = None
103
103
  ) -> CallStatusResponse:
104
- return self._make_request(
104
+ return self.request(
105
105
  "GET",
106
106
  endpoint=f"{Endpoints.CALLS_V1}/phone_status/{opponent_id}",
107
107
  data_type=CallStatusResponse,
@@ -119,7 +119,7 @@ def get_games(self, access_token: str = None, **params) -> GamesResponse:
119
119
  - from_id: int - (optional)
120
120
 
121
121
  """
122
- return self._make_request(
122
+ return self.request(
123
123
  "GET",
124
124
  endpoint=f"{Endpoints.GAMES_V1}/apps",
125
125
  params=params,
@@ -137,7 +137,7 @@ def get_genres(self, access_token: str = None, **params) -> GenresResponse:
137
137
  - from: int - (optional)
138
138
 
139
139
  """
140
- return self._make_request(
140
+ return self.request(
141
141
  "GET",
142
142
  endpoint=f"{Endpoints.GENRES_V1}",
143
143
  params=params,
@@ -157,7 +157,7 @@ def get_group_calls(self, access_token: str = None, **params) -> PostsResponse:
157
157
  - scope: str - (optional)
158
158
 
159
159
  """
160
- return self._make_request(
160
+ return self.request(
161
161
  "GET",
162
162
  endpoint=f"{Endpoints.POSTS_V1}/group_calls",
163
163
  params=params,
@@ -180,7 +180,7 @@ def invite_to_call_bulk(
180
180
  params = {}
181
181
  if group_id:
182
182
  params["group_id"] = group_id
183
- response = self._make_request(
183
+ response = self.request(
184
184
  "POST",
185
185
  endpoint=f"{Endpoints.CALLS_V1}/{call_id}/bulk_invite",
186
186
  params=params,
@@ -201,7 +201,7 @@ def invite_users_to_call(
201
201
  - user_ids: list[int] - (required)
202
202
 
203
203
  """
204
- response = self._make_request(
204
+ response = self.request(
205
205
  "POST",
206
206
  endpoint=f"{Endpoints.CALLS_V1}/conference_calls/{call_id}/invite",
207
207
  payload={"call_id": call_id, "user_ids": user_ids},
@@ -214,7 +214,7 @@ def invite_users_to_call(
214
214
  def invite_users_to_chat_call(
215
215
  self, chat_room_id: int, room_id: int, room_url: str, access_token: str = None
216
216
  ):
217
- response = self._make_request(
217
+ response = self.request(
218
218
  "POST",
219
219
  endpoint=f"{Endpoints.CALLS_V2}/invite",
220
220
  payload={
@@ -229,7 +229,7 @@ def invite_users_to_chat_call(
229
229
 
230
230
 
231
231
  def kick_and_ban_from_call(self, call_id: int, user_id: int, access_token: str = None):
232
- response = self._make_request(
232
+ response = self.request(
233
233
  "POST",
234
234
  endpoint=f"{Endpoints.CALLS_V1}/conference_calls/{call_id}/kick",
235
235
  payload={"user_id": user_id},
@@ -247,7 +247,7 @@ def set_call(
247
247
  category_id: str = None,
248
248
  access_token: str = None,
249
249
  ):
250
- response = self._make_request(
250
+ response = self.request(
251
251
  "PUT",
252
252
  endpoint=f"{Endpoints.CALLS_V1}/{call_id}",
253
253
  payload={
@@ -264,7 +264,7 @@ def set_call(
264
264
  def set_user_role(
265
265
  self, call_id: int, user_id: int, role: str, access_token: str = None
266
266
  ):
267
- response = self._make_request(
267
+ response = self.request(
268
268
  "PUT",
269
269
  endpoint=f"{Endpoints.CALLS_V1}/{call_id}/users/{user_id}",
270
270
  payload={"role": role},
@@ -277,7 +277,7 @@ def set_user_role(
277
277
  def start_call(
278
278
  self, conference_id: int, call_sid: str = None, access_token: str = None
279
279
  ) -> ConferenceCall:
280
- response = self._make_request(
280
+ response = self.request(
281
281
  "POST",
282
282
  endpoint=f"{Endpoints.CALLS_V1}/start_conference_call",
283
283
  payload={"conference_id": conference_id, "call_sid": call_sid},
@@ -289,7 +289,7 @@ def start_call(
289
289
 
290
290
 
291
291
  def start_anonymous_call(self, conference_id: int, agora_uid: str) -> ConferenceCall:
292
- response = self._make_request(
292
+ response = self.request(
293
293
  "POST",
294
294
  endpoint=f"{Endpoints.ANONYMOUS_CALLS_V1}/start_conference_call",
295
295
  payload={"conference_id": conference_id, "agora_uid": agora_uid},
@@ -300,7 +300,7 @@ def start_anonymous_call(self, conference_id: int, agora_uid: str) -> Conference
300
300
 
301
301
 
302
302
  def stop__anonymous_call(self, conference_id: int, agora_uid: str = None):
303
- response = self._make_request(
303
+ response = self.request(
304
304
  "POST",
305
305
  endpoint=f"{Endpoints.ANONYMOUS_CALLS_V1}/leave_conference_call",
306
306
  payload={"conference_id": conference_id, "agora_uid": agora_uid},
@@ -310,7 +310,7 @@ def stop__anonymous_call(self, conference_id: int, agora_uid: str = None):
310
310
 
311
311
 
312
312
  def stop_call(self, conference_id: int, call_sid: str = None, access_token: str = None):
313
- response = self._make_request(
313
+ response = self.request(
314
314
  "POST",
315
315
  endpoint=f"{Endpoints.CALLS_V1}/leave_conference_call",
316
316
  payload={"conference_id": conference_id, "call_sid": call_sid},
@@ -36,7 +36,7 @@ def get_user_activities(self, access_token: str = None, **params) -> ActivitiesR
36
36
  - number: int - (optional)
37
37
 
38
38
  """
39
- return self._make_request(
39
+ return self.request(
40
40
  "GET",
41
41
  endpoint=f"https://{Configs.YAY_STAGING_HOST_2}/api/user_activities",
42
42
  params=params,
@@ -57,7 +57,7 @@ def get_user_merged_activities(
57
57
  - number: int - (optional)
58
58
 
59
59
  """
60
- return self._make_request(
60
+ return self.request(
61
61
  "GET",
62
62
  endpoint=f"https://{Configs.YAY_STAGING_HOST_2}/api/v2/user_activities",
63
63
  params=params,
@@ -71,7 +71,7 @@ def received_notification(
71
71
  self, pid: str, type: str, opened_at: int = None, access_token: str = None
72
72
  ):
73
73
  # TODO: opened_atはnullalbeか確認する
74
- return self._make_request(
74
+ return self.request(
75
75
  "POST",
76
76
  endpoint=f"{Endpoints.BASE_API_URL}/api/received_push_notifications",
77
77
  payload={"pid": pid, "type": type, "opened_at": opened_at},
@@ -41,7 +41,7 @@ from ..responses import (
41
41
 
42
42
 
43
43
  def accept_chat_requests(self, chat_room_ids: list[int], access_token: str = None):
44
- response = self._make_request(
44
+ response = self.request(
45
45
  "POST",
46
46
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/accept_chat_request",
47
47
  payload={"chat_room_ids[]": chat_room_ids},
@@ -55,7 +55,7 @@ def accept_chat_requests(self, chat_room_ids: list[int], access_token: str = Non
55
55
  def check_unread_status(
56
56
  self, from_time: int, access_token: str = None
57
57
  ) -> UnreadStatusResponse:
58
- return self._make_request(
58
+ return self.request(
59
59
  "GET",
60
60
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/unread_status",
61
61
  params={"from_time": from_time},
@@ -73,7 +73,7 @@ def create_group_chat(
73
73
  background_filename: str = None,
74
74
  access_token: str = None,
75
75
  ) -> CreateChatRoomResponse:
76
- response = self._make_request(
76
+ response = self.request(
77
77
  "POST",
78
78
  endpoint=f"{Endpoints.CHAT_ROOMS_V3}/new",
79
79
  payload={
@@ -97,7 +97,7 @@ def create_private_chat(
97
97
  hima_chat: bool = False,
98
98
  access_token: str = None,
99
99
  ) -> CreateChatRoomResponse:
100
- response = self._make_request(
100
+ response = self.request(
101
101
  "POST",
102
102
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/new",
103
103
  payload={
@@ -114,7 +114,7 @@ def create_private_chat(
114
114
 
115
115
 
116
116
  def delete_background(self, room_id: int, access_token: str = None):
117
- response = self._make_request(
117
+ response = self.request(
118
118
  "DELETE",
119
119
  endpoint=f"{Endpoints.CHAT_ROOMS_V2}/{room_id}/background",
120
120
  auth_required=True,
@@ -125,7 +125,7 @@ def delete_background(self, room_id: int, access_token: str = None):
125
125
 
126
126
 
127
127
  def delete_message(self, room_id: int, message_id: int, access_token: str = None):
128
- response = self._make_request(
128
+ response = self.request(
129
129
  "DELETE",
130
130
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/{room_id}/messages/{message_id}/delete",
131
131
  auth_required=True,
@@ -143,7 +143,7 @@ def edit_chat_room(
143
143
  background_filename: str = None,
144
144
  access_token: str = None,
145
145
  ):
146
- response = self._make_request(
146
+ response = self.request(
147
147
  "POST",
148
148
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/{chat_room_id}/edit",
149
149
  payload={
@@ -166,7 +166,7 @@ def get_chatable_users(
166
166
  order_by: str = None,
167
167
  access_token: str = None,
168
168
  ) -> FollowUsersResponse:
169
- return self._make_request(
169
+ return self.request(
170
170
  "POST",
171
171
  endpoint=f"{Endpoints.USERS_V1}/followings/chatable",
172
172
  payload={
@@ -181,7 +181,7 @@ def get_chatable_users(
181
181
 
182
182
 
183
183
  def get_gifs_data(self, access_token: str = None) -> list[GifImageCategory]:
184
- return self._make_request(
184
+ return self.request(
185
185
  "GET",
186
186
  endpoint=f"{Endpoints.HIDDEN_V1}/chats",
187
187
  data_type=GifsDataResponse,
@@ -202,7 +202,7 @@ def get_hidden_chat_rooms(
202
202
  - number: int - (optional)
203
203
 
204
204
  """
205
- return self._make_request(
205
+ return self.request(
206
206
  "GET",
207
207
  endpoint=f"{Endpoints.HIDDEN_V1}/chats",
208
208
  params=params,
@@ -218,7 +218,7 @@ def get_main_chat_rooms(
218
218
  params = {}
219
219
  if from_timestamp:
220
220
  params["from_timestamp"] = from_timestamp
221
- return self._make_request(
221
+ return self.request(
222
222
  "GET",
223
223
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/main_list",
224
224
  params=params,
@@ -239,7 +239,7 @@ def get_messages(
239
239
  - to_message_id: int - (optional)
240
240
 
241
241
  """
242
- return self._make_request(
242
+ return self.request(
243
243
  "GET",
244
244
  endpoint=f"{Endpoints.CHAT_ROOMS_V2}/{chat_room_id}/messages",
245
245
  params=params,
@@ -262,7 +262,7 @@ def get_request_chat_rooms(
262
262
  - access_token: str (optional)
263
263
 
264
264
  """
265
- return self._make_request(
265
+ return self.request(
266
266
  "GET",
267
267
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/request_list",
268
268
  params=params,
@@ -273,7 +273,7 @@ def get_request_chat_rooms(
273
273
 
274
274
 
275
275
  def get_chat_room(self, chat_room_id: int, access_token: str = None) -> ChatRoom:
276
- return self._make_request(
276
+ return self.request(
277
277
  "GET",
278
278
  endpoint=f"{Endpoints.CHAT_ROOMS_V2}/{chat_room_id}",
279
279
  data_type=ChatRoomResponse,
@@ -283,7 +283,7 @@ def get_chat_room(self, chat_room_id: int, access_token: str = None) -> ChatRoom
283
283
 
284
284
 
285
285
  def get_sticker_packs(self, access_token: str = None) -> list[StickerPack]:
286
- return self._make_request(
286
+ return self.request(
287
287
  "GET",
288
288
  endpoint=Endpoints.STICKER_PACKS_V2,
289
289
  data_type=StickerPacksResponse,
@@ -293,7 +293,7 @@ def get_sticker_packs(self, access_token: str = None) -> list[StickerPack]:
293
293
 
294
294
 
295
295
  def get_total_chat_requests(self, access_token: str = None) -> int:
296
- return self._make_request(
296
+ return self.request(
297
297
  "GET",
298
298
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/total_chat_request",
299
299
  data_type=TotalChatRequestResponse,
@@ -303,7 +303,7 @@ def get_total_chat_requests(self, access_token: str = None) -> int:
303
303
 
304
304
 
305
305
  def hide_chat(self, chat_room_id: int, access_token: str = None):
306
- response = self._make_request(
306
+ response = self.request(
307
307
  "POST",
308
308
  endpoint=f"{Endpoints.HIDDEN_V1}/chats",
309
309
  payload={"chat_room_id": chat_room_id},
@@ -317,7 +317,7 @@ def hide_chat(self, chat_room_id: int, access_token: str = None):
317
317
  def invite_to_chat(
318
318
  self, chat_room_id: int, user_ids: list[int], access_token: str = None
319
319
  ):
320
- response = self._make_request(
320
+ response = self.request(
321
321
  "POST",
322
322
  endpoint=f"{Endpoints.CHAT_ROOMS_V2}/{chat_room_id}/invite",
323
323
  payload={"with_user_ids": user_ids},
@@ -331,7 +331,7 @@ def invite_to_chat(
331
331
  def kick_users_from_chat(
332
332
  self, chat_room_id: int, user_ids: list[int], access_token: str = None
333
333
  ):
334
- response = self._make_request(
334
+ response = self.request(
335
335
  "POST",
336
336
  endpoint=f"{Endpoints.CHAT_ROOMS_V2}/{chat_room_id}/kick",
337
337
  payload={"with_user_ids[]": user_ids},
@@ -343,7 +343,7 @@ def kick_users_from_chat(
343
343
 
344
344
 
345
345
  def pin_chat(self, room_id: int, access_token: str = None):
346
- response = self._make_request(
346
+ response = self.request(
347
347
  "POST",
348
348
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/{room_id}/pinned",
349
349
  auth_required=True,
@@ -354,7 +354,7 @@ def pin_chat(self, room_id: int, access_token: str = None):
354
354
 
355
355
 
356
356
  def read_message(self, chat_room_id: int, message_id: int, access_token: str = None):
357
- response = self._make_request(
357
+ response = self.request(
358
358
  "POST",
359
359
  endpoint=f"{Endpoints.CHAT_ROOMS_V2}/{chat_room_id}/messages/{message_id}/read",
360
360
  auth_required=True,
@@ -370,7 +370,7 @@ def refresh_chat_rooms(
370
370
  params = {}
371
371
  if from_time:
372
372
  params["from_time"] = from_time
373
- return self._make_request(
373
+ return self.request(
374
374
  "GET",
375
375
  endpoint=f"{Endpoints.CHAT_ROOMS_V2}/update",
376
376
  params=params,
@@ -382,7 +382,7 @@ def refresh_chat_rooms(
382
382
 
383
383
  def remove_chat_rooms(self, chat_room_ids: list[int], access_token: str = None):
384
384
  chat_room_ids = [chat_room_ids] if isinstance(chat_room_ids, int) else chat_room_ids
385
- response = self._make_request(
385
+ response = self.request(
386
386
  "POST",
387
387
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/mass_destroy",
388
388
  payload={"chat_room_ids": chat_room_ids},
@@ -405,7 +405,7 @@ def report_chat_room(
405
405
  screenshot_4_filename: str = None,
406
406
  access_token: str = None,
407
407
  ):
408
- response = self._make_request(
408
+ response = self.request(
409
409
  "POST",
410
410
  endpoint=f"{Endpoints.CHAT_ROOMS_V3}/{chat_room_id}/report",
411
411
  payload={
@@ -428,7 +428,7 @@ def report_chat_room(
428
428
  def send_message(
429
429
  self, chat_room_id: int, access_token: str = None, **params
430
430
  ) -> MessageResponse:
431
- response = self._make_request(
431
+ response = self.request(
432
432
  "POST",
433
433
  endpoint=f"{Endpoints.CHAT_ROOMS_V3}/{chat_room_id}/messages/new",
434
434
  payload=params,
@@ -441,7 +441,7 @@ def send_message(
441
441
 
442
442
 
443
443
  def unhide_chat(self, chat_room_ids: int, access_token: str = None):
444
- response = self._make_request(
444
+ response = self.request(
445
445
  "DELETE",
446
446
  endpoint=f"{Endpoints.HIDDEN_V1}/chats",
447
447
  params={"chat_room_ids": chat_room_ids},
@@ -453,7 +453,7 @@ def unhide_chat(self, chat_room_ids: int, access_token: str = None):
453
453
 
454
454
 
455
455
  def unpin_chat(self, chat_room_id: int, access_token: str = None):
456
- response = self._make_request(
456
+ response = self.request(
457
457
  "DELETE",
458
458
  endpoint=f"{Endpoints.CHAT_ROOMS_V1}/{chat_room_id}/pinned",
459
459
  auth_required=True,