yaylib 1.5.0b2__tar.gz → 1.5.0.dev2__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 (26) hide show
  1. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/PKG-INFO +127 -84
  2. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/README.md +126 -82
  3. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/pyproject.toml +0 -1
  4. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/__init__.py +1 -8
  5. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/auth.py +8 -10
  6. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/group.py +10 -16
  7. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/misc.py +3 -3
  8. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/post.py +36 -66
  9. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/user.py +18 -27
  10. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/client.py +10 -52
  11. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/device.py +3 -10
  12. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/errors.py +3 -8
  13. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/models.py +66 -68
  14. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/responses.py +90 -61
  15. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/utils.py +1 -1
  16. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/LICENSE +0 -0
  17. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/__init__.py +0 -0
  18. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/call.py +0 -0
  19. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/chat.py +0 -0
  20. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/notification.py +0 -0
  21. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/review.py +0 -0
  22. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/api/thread.py +0 -0
  23. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/config.py +0 -0
  24. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/constants.py +0 -0
  25. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/state.py +0 -0
  26. {yaylib-1.5.0b2 → yaylib-1.5.0.dev2}/yaylib/ws.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yaylib
3
- Version: 1.5.0b2
3
+ Version: 1.5.0.dev2
4
4
  Summary: 同世代と趣味の通話コミュニティ - Yay! (イェイ) で投稿やタイムラインの取得、リツイートやいいねの実行、フォローや投稿の検索など様々な機能をPythonプログラムから利用可能なAPIクライアントツールです。
5
5
  Home-page: https://github.com/ekkx/yaylib
6
6
  License: MIT
@@ -15,7 +15,6 @@ Classifier: Programming Language :: Python :: 3.11
15
15
  Requires-Dist: aiohttp (==3.9.5)
16
16
  Requires-Dist: cryptography (==41.0.1)
17
17
  Requires-Dist: pillow (==9.3.0)
18
- Requires-Dist: poetry-version-plugin (>=0.2.0,<0.3.0)
19
18
  Project-URL: Repository, https://github.com/ekkx/yaylib
20
19
  Description-Content-Type: text/markdown
21
20
 
@@ -28,7 +27,7 @@ Description-Content-Type: text/markdown
28
27
  </div>
29
28
  <br />
30
29
  <p align="center">
31
- <a href="https://ekkx.github.io/yaylib">
30
+ <a href="https://github.com/othneildrew/Best-README-Template">
32
31
  <img src="https://github.com/ekkx/yaylib/assets/77382767/45c45b21-d812-4cad-8f27-315ffef53201" alt="Logo" height="300px">
33
32
  </a>
34
33
  <h3 align="center">yaylib</h3>
@@ -42,78 +41,87 @@ Description-Content-Type: text/markdown
42
41
  </a>
43
42
  <br />
44
43
  <br />
45
- <a href="https://ekkx.github.io/yaylib">ドキュメント</a>
44
+ <a href="https://github.com/ekkx/yaylib/issues">Report Bug</a>
46
45
  ·
47
- <a href="https://github.com/ekkx/yaylib/issues/new">バグを報告</a>
46
+ <a href="https://github.com/ekkx/yaylib/issues">Request Feature</a>
48
47
  ·
49
- <a href="https://discord.gg/MEuBfNtqRN">Discord に参加</a>
48
+ <a href="https://discord.gg/MEuBfNtqRN">Join the discord</a>
50
49
  </p>
51
50
  </p>
52
51
 
53
- <br>
52
+ <!-- TABLE OF CONTENTS -->
53
+
54
+ <details>
55
+ <summary>Table of Contents</summary>
56
+ <ol>
57
+ <li><a href="#buy-me-a-coffee">Buy me a coffee</a></li>
58
+ <li><a href="#-installation">インストール</a></li>
59
+ <li><a href="#-quick-example">使用例</a></li>
60
+ <li><a href="#crown-yaylib-で誕生したロボットたち">yaylib で誕生したロボットたち</a></li>
61
+ <li><a href="#handshake-共同開発について">共同開発について</a></li>
62
+ <li><a href="#免責事項">免責事項</a></li>
63
+ <li><a href="#利用許諾">利用許諾</a></li>
64
+ </ol>
65
+ </details>
66
+
67
+ <!-- Buy me a coffee -->
68
+
69
+ ## Buy me a coffee
70
+
71
+ このライブラリが気に入っていただけたら、<a href="https://github.com/ekkx/yaylib/">**リポジトリにスターをお願いします</a>(⭐)**
72
+ また、Buy Me a Coffee からご支援いただけますと幸いです。
73
+
74
+ <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>
54
75
 
55
76
  <!-- インストール -->
56
77
 
57
78
  ## [<img src="https://github.com/ekkx/yaylib/assets/77382767/2f632349-0cbc-4c81-bc19-11d24c8c142b" width="30" height="30" />](https://github.com/ekkx) Installation
58
79
 
59
- **yaylib** `pip` コマンドからインストールします。
80
+ **※ Python 3.10 以上のバージョンが必要です。**
81
+
82
+ 「yaylib」をインストールするには、以下のコマンドをターミナル上で実行します:
60
83
 
61
84
  ```shell
62
85
  pip install yaylib
63
86
  ```
64
87
 
65
- > [!TIP]
66
- > 動作条件は `Python 3.10` 以上からです。
67
-
68
88
  <br>
69
89
 
70
- <!-- 使用例 -->
90
+ > [!TIP]
91
+ > 開発環境をインストールする場合は、以下の手順を実行します:
71
92
 
72
- ## [<img src="https://github.com/ekkx/yaylib/assets/77382767/dc7dcea0-c581-4039-8fc2-3994884d2ba3" width="30" height="30" />](https://github.com/ekkx) Quick Example
93
+ ```shell
94
+ git clone https://github.com/ekkx/yaylib.git
73
95
 
74
- #### ✨ 投稿を作成する
96
+ cd yaylib
75
97
 
76
- ```python
77
- import yaylib
98
+ make up
99
+ ```
78
100
 
79
- bot = yaylib.Client()
80
- bot.login('your_email', 'your_password')
101
+ <!-- 使用例 -->
81
102
 
82
- bot.create_post('Hello with yaylib!')
83
- ```
103
+ ## [<img src="https://github.com/ekkx/yaylib/assets/77382767/dc7dcea0-c581-4039-8fc2-3994884d2ba3" width="30" height="30" />](https://github.com/ekkx) Quick Example
84
104
 
85
- #### ✨ タイムラインを取得する
105
+ #### ✨ 投稿を作成する
86
106
 
87
107
  ```python
88
108
  import yaylib
89
109
 
90
- bot = yaylib.Client()
91
-
92
- timeline = bot.get_timeline(number=100)
110
+ client = yaylib.Client()
111
+ client.login(email="your_email", password="your_password")
93
112
 
94
- for post in timeline.posts:
95
- print(post.user.nickname) # 投稿者名
96
- print(post.text) # 本文
97
- print(post.likes_count) # いいね数
98
- print(post.reposts_count) # (´∀`∩)↑age↑の数
99
- print(post.in_reply_to_post_count) # 返信の数
113
+ client.create_post("Hello with yaylib!")
100
114
  ```
101
115
 
102
- #### ✨ タイムラインをキーワードで検索して「いいね」する
116
+ #### ✨ 埋め込みリンクの投稿を作成する
103
117
 
104
118
  ```python
105
119
  import yaylib
106
120
 
107
- bot = yaylib.Client()
108
- bot.login('your_email', 'your_password')
109
-
110
- timeline = bot.get_timeline_by_keyword(
111
- keyword='プログラミング',
112
- number=15
113
- )
121
+ client = yaylib.Client()
122
+ client.login(email="your_email", password="your_password")
114
123
 
115
- for post in timeline.posts:
116
- bot.like(post.id)
124
+ client.create_post("Hello with yaylib!", shared_url="https://github.com/ekkx/yaylib")
117
125
  ```
118
126
 
119
127
  #### ✨ 画像と一緒に投稿を作成する
@@ -121,87 +129,122 @@ for post in timeline.posts:
121
129
  ```python
122
130
  import yaylib
123
131
 
124
- bot = yaylib.Client()
125
- bot.login('your_email', 'your_password')
132
+ client = yaylib.Client()
133
+ client.login(email="your_email", password="your_password")
126
134
 
127
135
  # 画像のパスを指定
128
136
  image_paths = [
129
- './test1.jpg',
130
- './test2.jpg',
131
- './test3.jpg',
137
+ "./test1.jpg",
138
+ "./test2.jpg",
139
+ "./test3.jpg",
132
140
  ]
133
141
 
134
142
  # 画像の使い道を指定
135
- image_type = yaylib.ImageType.POST
143
+ image_type = yaylib.ImageType.post
136
144
 
137
145
  # サーバー上にアップロード
138
- attachments = bot.upload_image(image_paths, image_type)
146
+ attachments = client.upload_image(image_paths, image_type)
139
147
 
140
148
  # サーバー上のファイル名を指定する
141
149
  # attachmentsが一つ飛ばしなのはオリジナル品質の画像のみを指定するため
142
- bot.create_post(
143
- 'Hello with yaylib!',
150
+ client.create_post(
151
+ "Hello with yaylib!",
144
152
  attachment_filename=attachments[0].filename,
145
153
  attachment_2_filename=attachments[2].filename,
146
154
  attachment_3_filename=attachments[4].filename,
147
155
  )
148
156
  ```
149
157
 
158
+ #### ✨ タイムラインを 100 件取得する
159
+
160
+ ```python
161
+ import yaylib
162
+
163
+ client = yaylib.Client()
164
+
165
+ timeline = client.get_timeline(number=100)
166
+
167
+ for post in timeline.posts:
168
+ print(post.user.nickname) # 投稿者名
169
+ print(post.text) # 本文
170
+ print(post.likes_count) # いいね数
171
+ print(post.reposts_count) # (´∀`∩)↑age↑の数
172
+ print(post.in_reply_to_post_count) # 返信の数
173
+ ```
174
+
175
+ #### ✨ タイムラインをキーワードで検索して「いいね」する
176
+
177
+ ```python
178
+ import yaylib
179
+
180
+ client = yaylib.Client()
181
+ client.login(email="your_email", password="your_password")
182
+
183
+ timeline = client.get_timeline_by_keyword(
184
+ keyword="プログラミング",
185
+ number=15
186
+ )
187
+
188
+ for post in timeline.posts:
189
+ client.like(post.id)
190
+ ```
191
+
150
192
  #### ✨ 新規ユーザーをフォローする
151
193
 
152
194
  ```python
153
195
  import yaylib
154
196
 
155
- bot = yaylib.Client()
156
- bot.login('your_email', 'your_password')
197
+ client = yaylib.Client()
198
+ client.login(email="your_email", password="your_password")
157
199
 
158
- new_users = bot.search_users(recently_created=True)
200
+ new_users = client.search_users(recently_created=True)
159
201
 
160
202
  for new_user in new_users.users:
161
- bot.follow_user(new_user.id)
203
+ client.follow_user(new_user.id)
162
204
  ```
163
205
 
164
206
  #### ✨ リアルタイムでチャットを取得する
165
207
 
166
208
  ```python
167
209
  import yaylib
210
+ from yaylib import Message
168
211
 
169
- class ChatBot(yaylib.Client):
170
- async def on_ready():
171
- print('Botがオンラインになりました!')
212
+ class MyBot(yaylib.Client):
213
+ def on_ready(self):
214
+ print("ボットがオンラインになりました!")
172
215
 
173
- async def on_chat_request(self, total_count):
174
- # チャットリクエストを承認し on_message() に送信する
175
- chat_requests = await self.chat.get_chat_requests()
216
+ def on_chat_request(self, total_count):
217
+ # チャットリクエストはすべて承認する
218
+ chat_requests = self.get_chat_requests()
176
219
  for chat_room in chat_requests.chat_rooms:
177
- await self.chat.accept_chat_requests(chat_room_ids=[chat_room.id])
178
- message = await self.chat.get_messages(chat_requests.chat_rooms[0].id)
179
- await self.on_message(message[0])
220
+ self.accept_chat_requests([chat_room.id])
221
+
222
+ # 最新のメッセージをon_message_create関数に送信
223
+ message = self.get_messages(chat_requests.chat_rooms[0].id)
224
+ self.on_message_create(message[0])
180
225
 
181
- async def on_message(self, message: yaylib.Message):
182
- if message.text == 'ping':
183
- await self.chat.send_message(
184
- message.room_id,
185
- text='pong',
186
- )
226
+ def on_message_create(self, message: Message):
227
+ # ping」というメッセージに対して「pong」と返信する
228
+ if message.text == "ping":
229
+ self.send_message(message.room_id, text="pong")
187
230
 
188
- async def on_chat_delete(self, room_id):
189
- print(f'チャットルームが削除されました。{room_id}')
231
+ def on_chat_room_delete(self, room_id):
232
+ print(f"チャットルームが削除されました。ルームID: {room_id}")
190
233
 
191
234
  intents = yaylib.Intents.none()
192
235
  intents.chat_message = True
193
236
 
194
- bot = ChatBot(intents=intents)
195
- bot.run('your_email', 'your_password')
237
+ bot = MyBot(intents=intents)
238
+ bot.run("your_email", "your_password")
196
239
  ```
197
240
 
198
- より詳しい使用例については、[ドキュメント](https://ekkx.github.io/yaylib/demo.html)を参照してください。
241
+ より詳しい使用例については、[こちら](https://github.com/ekkx/yaylib/blob/master/examples) を参照してください。
199
242
 
200
- <br>
243
+ <p align="right">(<a href="#readme-top">トップに戻る</a>)</p>
201
244
 
202
245
  <!-- yaylib で誕生したボットの一覧 -->
203
246
 
204
- ## 👑 yaylib で誕生したロボットたち
247
+ ## :crown: yaylib で誕生したロボットたち
205
248
 
206
249
  「yaylib」を用いて開発したロボットがある場合は、ぜひ教えてください!
207
250
 
@@ -234,27 +277,27 @@ bot.run('your_email', 'your_password')
234
277
  </tbody>
235
278
  </table>
236
279
 
237
- <br>
238
-
239
280
  <!-- 共同開発について -->
240
281
 
241
- ## 🤝 共同開発について
282
+ ## :handshake: 共同開発について
242
283
 
243
- 詳しい **yaylib** の開発参加手順については、[こちら](https://github.com/ekkx/yaylib/blob/develop/CONTRIBUTING.md)を参照してください。
284
+ 私たちと開発することに興味を持っていただけているなら、ぜひ参加して頂きたいです!
244
285
 
245
- <br>
286
+ - [プルリクエストを送信する](https://github.com/ekkx/yaylib/pulls)
287
+ - [Discord サーバーに参加する](https://discord.gg/MEuBfNtqRN)
288
+ - [nikola.desuga@gmail.com](mailto:nikola.desuga@gmail.com) にメールを送信する
289
+
290
+ のいずれかの方法で繋がりましょう。詳しくは[こちらから](https://github.com/ekkx/yaylib/blob/master/CONTRIBUTING.md)!
246
291
 
247
292
  <!-- 免責事項 -->
248
293
 
249
- ## 📜 免責事項
294
+ ## 免責事項
250
295
 
251
296
  yaylib は、API の公式なサポートやメンテナンスを提供するものではありません。このクライアントを使用する場合、**利用者はリスクや責任を自己負担できるもの**とします。このクライアントによって提供される情報やデータの正確性、信頼性、完全性、適時性について、いかなる保証も行いません。また、このクライアントの使用によって生じた損害や不利益について、一切の責任を負いかねます。利用者は自己の責任において、このクライアントを使用し、API にアクセスするものとします。なお、この免責事項は予告なく変更される場合があります。
252
297
 
253
- <br>
254
-
255
298
  <!-- ライセンス -->
256
299
 
257
- ## ⚖️ ライセンス
300
+ ## ライセンス
258
301
 
259
302
  <p align="center">
260
303
  <a href="https://github.com/ekkx">
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
  <br />
9
9
  <p align="center">
10
- <a href="https://ekkx.github.io/yaylib">
10
+ <a href="https://github.com/othneildrew/Best-README-Template">
11
11
  <img src="https://github.com/ekkx/yaylib/assets/77382767/45c45b21-d812-4cad-8f27-315ffef53201" alt="Logo" height="300px">
12
12
  </a>
13
13
  <h3 align="center">yaylib</h3>
@@ -21,78 +21,87 @@
21
21
  </a>
22
22
  <br />
23
23
  <br />
24
- <a href="https://ekkx.github.io/yaylib">ドキュメント</a>
24
+ <a href="https://github.com/ekkx/yaylib/issues">Report Bug</a>
25
25
  ·
26
- <a href="https://github.com/ekkx/yaylib/issues/new">バグを報告</a>
26
+ <a href="https://github.com/ekkx/yaylib/issues">Request Feature</a>
27
27
  ·
28
- <a href="https://discord.gg/MEuBfNtqRN">Discord に参加</a>
28
+ <a href="https://discord.gg/MEuBfNtqRN">Join the discord</a>
29
29
  </p>
30
30
  </p>
31
31
 
32
- <br>
32
+ <!-- TABLE OF CONTENTS -->
33
+
34
+ <details>
35
+ <summary>Table of Contents</summary>
36
+ <ol>
37
+ <li><a href="#buy-me-a-coffee">Buy me a coffee</a></li>
38
+ <li><a href="#-installation">インストール</a></li>
39
+ <li><a href="#-quick-example">使用例</a></li>
40
+ <li><a href="#crown-yaylib-で誕生したロボットたち">yaylib で誕生したロボットたち</a></li>
41
+ <li><a href="#handshake-共同開発について">共同開発について</a></li>
42
+ <li><a href="#免責事項">免責事項</a></li>
43
+ <li><a href="#利用許諾">利用許諾</a></li>
44
+ </ol>
45
+ </details>
46
+
47
+ <!-- Buy me a coffee -->
48
+
49
+ ## Buy me a coffee
50
+
51
+ このライブラリが気に入っていただけたら、<a href="https://github.com/ekkx/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>
33
55
 
34
56
  <!-- インストール -->
35
57
 
36
58
  ## [<img src="https://github.com/ekkx/yaylib/assets/77382767/2f632349-0cbc-4c81-bc19-11d24c8c142b" width="30" height="30" />](https://github.com/ekkx) Installation
37
59
 
38
- **yaylib** `pip` コマンドからインストールします。
60
+ **※ Python 3.10 以上のバージョンが必要です。**
61
+
62
+ 「yaylib」をインストールするには、以下のコマンドをターミナル上で実行します:
39
63
 
40
64
  ```shell
41
65
  pip install yaylib
42
66
  ```
43
67
 
44
- > [!TIP]
45
- > 動作条件は `Python 3.10` 以上からです。
46
-
47
68
  <br>
48
69
 
49
- <!-- 使用例 -->
70
+ > [!TIP]
71
+ > 開発環境をインストールする場合は、以下の手順を実行します:
50
72
 
51
- ## [<img src="https://github.com/ekkx/yaylib/assets/77382767/dc7dcea0-c581-4039-8fc2-3994884d2ba3" width="30" height="30" />](https://github.com/ekkx) Quick Example
73
+ ```shell
74
+ git clone https://github.com/ekkx/yaylib.git
52
75
 
53
- #### ✨ 投稿を作成する
76
+ cd yaylib
54
77
 
55
- ```python
56
- import yaylib
78
+ make up
79
+ ```
57
80
 
58
- bot = yaylib.Client()
59
- bot.login('your_email', 'your_password')
81
+ <!-- 使用例 -->
60
82
 
61
- bot.create_post('Hello with yaylib!')
62
- ```
83
+ ## [<img src="https://github.com/ekkx/yaylib/assets/77382767/dc7dcea0-c581-4039-8fc2-3994884d2ba3" width="30" height="30" />](https://github.com/ekkx) Quick Example
63
84
 
64
- #### ✨ タイムラインを取得する
85
+ #### ✨ 投稿を作成する
65
86
 
66
87
  ```python
67
88
  import yaylib
68
89
 
69
- bot = yaylib.Client()
70
-
71
- timeline = bot.get_timeline(number=100)
90
+ client = yaylib.Client()
91
+ client.login(email="your_email", password="your_password")
72
92
 
73
- for post in timeline.posts:
74
- print(post.user.nickname) # 投稿者名
75
- print(post.text) # 本文
76
- print(post.likes_count) # いいね数
77
- print(post.reposts_count) # (´∀`∩)↑age↑の数
78
- print(post.in_reply_to_post_count) # 返信の数
93
+ client.create_post("Hello with yaylib!")
79
94
  ```
80
95
 
81
- #### ✨ タイムラインをキーワードで検索して「いいね」する
96
+ #### ✨ 埋め込みリンクの投稿を作成する
82
97
 
83
98
  ```python
84
99
  import yaylib
85
100
 
86
- bot = yaylib.Client()
87
- bot.login('your_email', 'your_password')
88
-
89
- timeline = bot.get_timeline_by_keyword(
90
- keyword='プログラミング',
91
- number=15
92
- )
101
+ client = yaylib.Client()
102
+ client.login(email="your_email", password="your_password")
93
103
 
94
- for post in timeline.posts:
95
- bot.like(post.id)
104
+ client.create_post("Hello with yaylib!", shared_url="https://github.com/ekkx/yaylib")
96
105
  ```
97
106
 
98
107
  #### ✨ 画像と一緒に投稿を作成する
@@ -100,87 +109,122 @@ for post in timeline.posts:
100
109
  ```python
101
110
  import yaylib
102
111
 
103
- bot = yaylib.Client()
104
- bot.login('your_email', 'your_password')
112
+ client = yaylib.Client()
113
+ client.login(email="your_email", password="your_password")
105
114
 
106
115
  # 画像のパスを指定
107
116
  image_paths = [
108
- './test1.jpg',
109
- './test2.jpg',
110
- './test3.jpg',
117
+ "./test1.jpg",
118
+ "./test2.jpg",
119
+ "./test3.jpg",
111
120
  ]
112
121
 
113
122
  # 画像の使い道を指定
114
- image_type = yaylib.ImageType.POST
123
+ image_type = yaylib.ImageType.post
115
124
 
116
125
  # サーバー上にアップロード
117
- attachments = bot.upload_image(image_paths, image_type)
126
+ attachments = client.upload_image(image_paths, image_type)
118
127
 
119
128
  # サーバー上のファイル名を指定する
120
129
  # attachmentsが一つ飛ばしなのはオリジナル品質の画像のみを指定するため
121
- bot.create_post(
122
- 'Hello with yaylib!',
130
+ client.create_post(
131
+ "Hello with yaylib!",
123
132
  attachment_filename=attachments[0].filename,
124
133
  attachment_2_filename=attachments[2].filename,
125
134
  attachment_3_filename=attachments[4].filename,
126
135
  )
127
136
  ```
128
137
 
138
+ #### ✨ タイムラインを 100 件取得する
139
+
140
+ ```python
141
+ import yaylib
142
+
143
+ client = yaylib.Client()
144
+
145
+ timeline = client.get_timeline(number=100)
146
+
147
+ for post in timeline.posts:
148
+ print(post.user.nickname) # 投稿者名
149
+ print(post.text) # 本文
150
+ print(post.likes_count) # いいね数
151
+ print(post.reposts_count) # (´∀`∩)↑age↑の数
152
+ print(post.in_reply_to_post_count) # 返信の数
153
+ ```
154
+
155
+ #### ✨ タイムラインをキーワードで検索して「いいね」する
156
+
157
+ ```python
158
+ import yaylib
159
+
160
+ client = yaylib.Client()
161
+ client.login(email="your_email", password="your_password")
162
+
163
+ timeline = client.get_timeline_by_keyword(
164
+ keyword="プログラミング",
165
+ number=15
166
+ )
167
+
168
+ for post in timeline.posts:
169
+ client.like(post.id)
170
+ ```
171
+
129
172
  #### ✨ 新規ユーザーをフォローする
130
173
 
131
174
  ```python
132
175
  import yaylib
133
176
 
134
- bot = yaylib.Client()
135
- bot.login('your_email', 'your_password')
177
+ client = yaylib.Client()
178
+ client.login(email="your_email", password="your_password")
136
179
 
137
- new_users = bot.search_users(recently_created=True)
180
+ new_users = client.search_users(recently_created=True)
138
181
 
139
182
  for new_user in new_users.users:
140
- bot.follow_user(new_user.id)
183
+ client.follow_user(new_user.id)
141
184
  ```
142
185
 
143
186
  #### ✨ リアルタイムでチャットを取得する
144
187
 
145
188
  ```python
146
189
  import yaylib
190
+ from yaylib import Message
147
191
 
148
- class ChatBot(yaylib.Client):
149
- async def on_ready():
150
- print('Botがオンラインになりました!')
192
+ class MyBot(yaylib.Client):
193
+ def on_ready(self):
194
+ print("ボットがオンラインになりました!")
151
195
 
152
- async def on_chat_request(self, total_count):
153
- # チャットリクエストを承認し on_message() に送信する
154
- chat_requests = await self.chat.get_chat_requests()
196
+ def on_chat_request(self, total_count):
197
+ # チャットリクエストはすべて承認する
198
+ chat_requests = self.get_chat_requests()
155
199
  for chat_room in chat_requests.chat_rooms:
156
- await self.chat.accept_chat_requests(chat_room_ids=[chat_room.id])
157
- message = await self.chat.get_messages(chat_requests.chat_rooms[0].id)
158
- await self.on_message(message[0])
200
+ self.accept_chat_requests([chat_room.id])
201
+
202
+ # 最新のメッセージをon_message_create関数に送信
203
+ message = self.get_messages(chat_requests.chat_rooms[0].id)
204
+ self.on_message_create(message[0])
159
205
 
160
- async def on_message(self, message: yaylib.Message):
161
- if message.text == 'ping':
162
- await self.chat.send_message(
163
- message.room_id,
164
- text='pong',
165
- )
206
+ def on_message_create(self, message: Message):
207
+ # ping」というメッセージに対して「pong」と返信する
208
+ if message.text == "ping":
209
+ self.send_message(message.room_id, text="pong")
166
210
 
167
- async def on_chat_delete(self, room_id):
168
- print(f'チャットルームが削除されました。{room_id}')
211
+ def on_chat_room_delete(self, room_id):
212
+ print(f"チャットルームが削除されました。ルームID: {room_id}")
169
213
 
170
214
  intents = yaylib.Intents.none()
171
215
  intents.chat_message = True
172
216
 
173
- bot = ChatBot(intents=intents)
174
- bot.run('your_email', 'your_password')
217
+ bot = MyBot(intents=intents)
218
+ bot.run("your_email", "your_password")
175
219
  ```
176
220
 
177
- より詳しい使用例については、[ドキュメント](https://ekkx.github.io/yaylib/demo.html)を参照してください。
221
+ より詳しい使用例については、[こちら](https://github.com/ekkx/yaylib/blob/master/examples) を参照してください。
178
222
 
179
- <br>
223
+ <p align="right">(<a href="#readme-top">トップに戻る</a>)</p>
180
224
 
181
225
  <!-- yaylib で誕生したボットの一覧 -->
182
226
 
183
- ## 👑 yaylib で誕生したロボットたち
227
+ ## :crown: yaylib で誕生したロボットたち
184
228
 
185
229
  「yaylib」を用いて開発したロボットがある場合は、ぜひ教えてください!
186
230
 
@@ -213,27 +257,27 @@ bot.run('your_email', 'your_password')
213
257
  </tbody>
214
258
  </table>
215
259
 
216
- <br>
217
-
218
260
  <!-- 共同開発について -->
219
261
 
220
- ## 🤝 共同開発について
262
+ ## :handshake: 共同開発について
221
263
 
222
- 詳しい **yaylib** の開発参加手順については、[こちら](https://github.com/ekkx/yaylib/blob/develop/CONTRIBUTING.md)を参照してください。
264
+ 私たちと開発することに興味を持っていただけているなら、ぜひ参加して頂きたいです!
223
265
 
224
- <br>
266
+ - [プルリクエストを送信する](https://github.com/ekkx/yaylib/pulls)
267
+ - [Discord サーバーに参加する](https://discord.gg/MEuBfNtqRN)
268
+ - [nikola.desuga@gmail.com](mailto:nikola.desuga@gmail.com) にメールを送信する
269
+
270
+ のいずれかの方法で繋がりましょう。詳しくは[こちらから](https://github.com/ekkx/yaylib/blob/master/CONTRIBUTING.md)!
225
271
 
226
272
  <!-- 免責事項 -->
227
273
 
228
- ## 📜 免責事項
274
+ ## 免責事項
229
275
 
230
276
  yaylib は、API の公式なサポートやメンテナンスを提供するものではありません。このクライアントを使用する場合、**利用者はリスクや責任を自己負担できるもの**とします。このクライアントによって提供される情報やデータの正確性、信頼性、完全性、適時性について、いかなる保証も行いません。また、このクライアントの使用によって生じた損害や不利益について、一切の責任を負いかねます。利用者は自己の責任において、このクライアントを使用し、API にアクセスするものとします。なお、この免責事項は予告なく変更される場合があります。
231
277
 
232
- <br>
233
-
234
278
  <!-- ライセンス -->
235
279
 
236
- ## ⚖️ ライセンス
280
+ ## ライセンス
237
281
 
238
282
  <p align="center">
239
283
  <a href="https://github.com/ekkx">