disnake

Форк
0
429 строк · 12.3 Кб
1
# SOME DESCRIPTIVE TITLE.
2
# Copyright (C) 2015-present, Rapptz
3
# This file is distributed under the same license as the disnake package.
4
# FIRST AUTHOR <EMAIL@ADDRESS>, 2020.
5
#
6
#, fuzzy
7
msgid ""
8
msgstr ""
9
"Project-Id-Version: disnake 1.5.1\n"
10
"Report-Msgid-Bugs-To: \n"
11
"POT-Creation-Date: 2020-10-23 22:41-0400\n"
12
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
"Language-Team: LANGUAGE <LL@li.org>\n"
15
"MIME-Version: 1.0\n"
16
"Content-Type: text/plain; charset=utf-8\n"
17
"Content-Transfer-Encoding: 8bit\n"
18
"Generated-By: Babel 2.5.3\n"
19

20
#: ../../intents.rst:6
21
msgid "A Primer to Gateway Intents"
22
msgstr ""
23

24
#: ../../intents.rst:8
25
msgid ""
26
"In version 1.5 comes the introduction of :class:`Intents`. This is a "
27
"radical change in how bots are written. An intent basically allows a bot "
28
"to subscribe into specific buckets of events. The events that correspond "
29
"to each intent is documented in the individual attribute of the "
30
":class:`Intents` documentation."
31
msgstr ""
32

33
#: ../../intents.rst:10
34
msgid ""
35
"These intents are passed to the constructor of :class:`Client` or its "
36
"subclasses (:class:`AutoShardedClient`, :class:`~.AutoShardedBot`, "
37
":class:`~.Bot`) with the ``intents`` argument."
38
msgstr ""
39

40
#: ../../intents.rst:12
41
msgid ""
42
"If intents are not passed, then the library defaults to every intent "
43
"being enabled except the privileged intents, currently "
44
":attr:`Intents.members` and :attr:`Intents.presences`."
45
msgstr ""
46

47
#: ../../intents.rst:15
48
msgid "What intents are needed?"
49
msgstr ""
50

51
#: ../../intents.rst:17
52
msgid ""
53
"The intents that are necessary for your bot can only be dictated by "
54
"yourself. Each attribute in the :class:`Intents` class documents what "
55
":ref:`events <disnake-api-events>` it corresponds to and what kind of "
56
"cache it enables."
57
msgstr ""
58

59
#: ../../intents.rst:19
60
msgid ""
61
"For example, if you want a bot that functions without spammy events like "
62
"presences or typing then we could do the following:"
63
msgstr ""
64

65
#: ../../intents.rst:34
66
msgid ""
67
"Note that this doesn't enable :attr:`Intents.members` since it's a "
68
"privileged intent."
69
msgstr ""
70

71
#: ../../intents.rst:36
72
msgid ""
73
"Another example showing a bot that only deals with messages and guild "
74
"information:"
75
msgstr ""
76

77
#: ../../intents.rst:54
78
msgid "Privileged Intents"
79
msgstr ""
80

81
#: ../../intents.rst:56
82
msgid ""
83
"With the API change requiring bot authors to specify intents, some "
84
"intents were restricted further and require more manual steps. These "
85
"intents are called **privileged intents**."
86
msgstr ""
87

88
#: ../../intents.rst:58
89
msgid ""
90
"A privileged intent is one that requires you to go to the developer "
91
"portal and manually enable it. To enable privileged intents do the "
92
"following:"
93
msgstr ""
94

95
#: ../../intents.rst:60
96
msgid ""
97
"Make sure you're logged on to the `Discord website "
98
"<https://discord.com>`_."
99
msgstr ""
100

101
#: ../../intents.rst:61
102
msgid ""
103
"Navigate to the `application page "
104
"<https://discord.com/developers/applications>`_"
105
msgstr ""
106

107
#: ../../intents.rst:62
108
msgid "Click on the bot you want to enable privileged intents for."
109
msgstr ""
110

111
#: ../../intents.rst:63
112
msgid "Navigate to the bot tab on the left side of the screen."
113
msgstr ""
114

115
#: ../../intents.rst:68
116
msgid ""
117
"Scroll down to the \"Privileged Gateway Intents\" section and enable the "
118
"ones you want."
119
msgstr ""
120

121
#: ../../intents.rst:75
122
msgid ""
123
"Enabling privileged intents when your bot is in over 100 guilds requires "
124
"going through `bot verification <https://support.discord.com/hc/en-"
125
"us/articles/360040720412>`_. If your bot is already verified and you "
126
"would like to enable a privileged intent you must go through `disnake "
127
"support <https://dis.gd/contact>`_ and talk to them about it."
128
msgstr ""
129

130
#: ../../intents.rst:79
131
msgid ""
132
"Even if you enable intents through the developer portal, you still have "
133
"to enable the intents through code as well."
134
msgstr ""
135

136
#: ../../intents.rst:83
137
msgid "Do I need privileged intents?"
138
msgstr ""
139

140
#: ../../intents.rst:85
141
msgid "This is a quick checklist to see if you need specific privileged intents."
142
msgstr ""
143

144
#: ../../intents.rst:90
145
msgid "Presence Intent"
146
msgstr ""
147

148
#: ../../intents.rst:92
149
msgid "Whether you use :attr:`Member.status` at all to track member statuses."
150
msgstr ""
151

152
#: ../../intents.rst:93
153
msgid ""
154
"Whether you use :attr:`Member.activity` or :attr:`Member.activities` to "
155
"check member's activities."
156
msgstr ""
157

158
#: ../../intents.rst:98
159
msgid "Member Intent"
160
msgstr ""
161

162
#: ../../intents.rst:100
163
msgid ""
164
"Whether you track member joins or member leaves, corresponds to "
165
":func:`on_member_join` and :func:`on_member_remove` events."
166
msgstr ""
167

168
#: ../../intents.rst:101
169
msgid "Whether you want to track member updates such as nickname or role changes."
170
msgstr ""
171

172
#: ../../intents.rst:102
173
msgid ""
174
"Whether you want to track user updates such as usernames, avatars, "
175
"discriminators, etc."
176
msgstr ""
177

178
#: ../../intents.rst:103
179
msgid ""
180
"Whether you want to request the guild member list through "
181
":meth:`Guild.chunk` or :meth:`Guild.fetch_members`."
182
msgstr ""
183

184
#: ../../intents.rst:104
185
msgid "Whether you want high accuracy member cache under :attr:`Guild.members`."
186
msgstr ""
187

188
#: ../../intents.rst:109
189
msgid "Member Cache"
190
msgstr ""
191

192
#: ../../intents.rst:111
193
msgid ""
194
"Along with intents, Discord now further restricts the ability to cache "
195
"members and expects bot authors to cache as little as is necessary. "
196
"However, to properly maintain a cache the :attr:`Intents.members` intent "
197
"is required in order to track the members who left and properly evict "
198
"them."
199
msgstr ""
200

201
#: ../../intents.rst:113
202
msgid ""
203
"To aid with member cache where we don't need members to be cached, the "
204
"library now has a :class:`MemberCacheFlags` flag to control the member "
205
"cache. The documentation page for the class goes over the specific "
206
"policies that are possible."
207
msgstr ""
208

209
#: ../../intents.rst:115
210
msgid ""
211
"It should be noted that certain things do not need a member cache since "
212
"Discord will provide full member information if possible. For example:"
213
msgstr ""
214

215
#: ../../intents.rst:117
216
msgid ""
217
":func:`on_message` will have :attr:`Message.author` be a member even if "
218
"cache is disabled."
219
msgstr ""
220

221
#: ../../intents.rst:118
222
msgid ""
223
":func:`on_voice_state_update` will have the ``member`` parameter be a "
224
"member even if cache is disabled."
225
msgstr ""
226

227
#: ../../intents.rst:119
228
msgid ""
229
":func:`on_reaction_add` will have the ``user`` parameter be a member even"
230
" if cache is disabled."
231
msgstr ""
232

233
#: ../../intents.rst:120
234
msgid ""
235
":func:`on_raw_reaction_add` will have "
236
":attr:`RawReactionActionEvent.member` be a member even if cache is "
237
"disabled."
238
msgstr ""
239

240
#: ../../intents.rst:121
241
msgid ""
242
"The reaction removal events do not have the member information. This is a"
243
" Discord limitation."
244
msgstr ""
245

246
#: ../../intents.rst:123
247
msgid ""
248
"Other events that take a :class:`Member` will require the use of the "
249
"member cache. If absolute accuracy over the member cache is desirable, "
250
"then it is advisable to have the :attr:`Intents.members` intent enabled."
251
msgstr ""
252

253
#: ../../intents.rst:128
254
msgid "Retrieving Members"
255
msgstr ""
256

257
#: ../../intents.rst:130
258
msgid ""
259
"If cache is disabled or you disable chunking guilds at startup, we might "
260
"still need a way to load members. The library offers a few ways to do "
261
"this:"
262
msgstr ""
263

264
#: ../../intents.rst:134
265
msgid ":meth:`Guild.query_members`"
266
msgstr ""
267

268
#: ../../intents.rst:133
269
msgid "Used to query members by a prefix matching nickname or username."
270
msgstr ""
271

272
#: ../../intents.rst:134
273
msgid "This can also be used to query members by their user ID."
274
msgstr ""
275

276
#: ../../intents.rst:135
277
msgid "This uses the gateway and not the HTTP."
278
msgstr ""
279

280
#: ../../intents.rst:136
281
msgid ":meth:`Guild.chunk`"
282
msgstr ""
283

284
#: ../../intents.rst:137
285
msgid "This can be used to fetch the entire member list through the gateway."
286
msgstr ""
287

288
#: ../../intents.rst:138
289
msgid ":meth:`Guild.fetch_member`"
290
msgstr ""
291

292
#: ../../intents.rst:139
293
msgid "Used to fetch a member by ID through the HTTP API."
294
msgstr ""
295

296
#: ../../intents.rst:141
297
msgid ":meth:`Guild.fetch_members`"
298
msgstr ""
299

300
#: ../../intents.rst:141
301
msgid "used to fetch a large number of members through the HTTP API."
302
msgstr ""
303

304
#: ../../intents.rst:143
305
msgid ""
306
"It should be noted that the gateway has a strict rate limit of 120 "
307
"requests per 60 seconds."
308
msgstr ""
309

310
#: ../../intents.rst:146
311
msgid "Troubleshooting"
312
msgstr ""
313

314
#: ../../intents.rst:148
315
msgid "Some common issues relating to the mandatory intent change."
316
msgstr ""
317

318
#: ../../intents.rst:151
319
msgid "Where'd my members go?"
320
msgstr ""
321

322
#: ../../intents.rst:153
323
msgid ""
324
"Due to an :ref:`API change <intents_member_cache>` Discord is now forcing"
325
" developers who want member caching to explicitly opt-in to it. This is a"
326
" Discord mandated change and there is no way to bypass it. In order to "
327
"get members back you have to explicitly enable the :ref:`members "
328
"privileged intent <privileged_intents>` and change the "
329
":attr:`Intents.members` attribute to true."
330
msgstr ""
331

332
#: ../../intents.rst:155
333
msgid "For example:"
334
msgstr ""
335

336
#: ../../intents.rst:170
337
msgid "Why does ``on_ready`` take so long to fire?"
338
msgstr ""
339

340
#: ../../intents.rst:172
341
msgid ""
342
"As part of the API change regarding intents, Discord also changed how "
343
"members are loaded in the beginning. Originally the library could request"
344
" 75 guilds at once and only request members from guilds that have the "
345
":attr:`Guild.large` attribute set to ``True``. With the new intent "
346
"changes, Discord mandates that we can only send 1 guild per request. This"
347
" causes a 75x slowdown which is further compounded by the fact that *all*"
348
" guilds, not just large guilds are being requested."
349
msgstr ""
350

351
#: ../../intents.rst:174
352
msgid "There are a few solutions to fix this."
353
msgstr ""
354

355
#: ../../intents.rst:176
356
msgid ""
357
"The first solution is to request the privileged presences intent along "
358
"with the privileged members intent and enable both of them. This allows "
359
"the initial member list to contain online members just like the old "
360
"gateway. Note that we're still limited to 1 guild per request but the "
361
"number of guilds we request is significantly reduced."
362
msgstr ""
363

364
#: ../../intents.rst:178
365
msgid ""
366
"The second solution is to disable member chunking by setting "
367
"``chunk_guilds_at_startup`` to ``False`` when constructing a client. "
368
"Then, when chunking for a guild is necessary you can use the various "
369
"techniques to :ref:`retrieve members <retrieving_members>`."
370
msgstr ""
371

372
#: ../../intents.rst:180
373
msgid ""
374
"To illustrate the slowdown caused the API change, take a bot who is in "
375
"840 guilds and 95 of these guilds are \"large\" (over 250 members)."
376
msgstr ""
377

378
#: ../../intents.rst:182
379
msgid ""
380
"Under the original system this would result in 2 requests to fetch the "
381
"member list (75 guilds, 20 guilds) roughly taking 60 seconds. With "
382
":attr:`Intents.members` but not :attr:`Intents.presences` this requires "
383
"840 requests, with a rate limit of 120 requests per 60 seconds means that"
384
" due to waiting for the rate limit it totals to around 7 minutes of "
385
"waiting for the rate limit to fetch all the members. With both "
386
":attr:`Intents.members` and :attr:`Intents.presences` we mostly get the "
387
"old behaviour so we're only required to request for the 95 guilds that "
388
"are large, this is slightly less than our rate limit so it's close to the"
389
" original timing to fetch the member list."
390
msgstr ""
391

392
#: ../../intents.rst:184
393
msgid ""
394
"Unfortunately due to this change being required from Discord there is "
395
"nothing that the library can do to mitigate this."
396
msgstr ""
397

398
#: ../../intents.rst:187
399
msgid "I don't like this, can I go back?"
400
msgstr ""
401

402
#: ../../intents.rst:189
403
msgid ""
404
"For now, the old gateway will still work so downgrading to disnake "
405
"v1.4 is still possible and will continue to be supported until Discord "
406
"officially kills the v6 gateway, which is imminent. However it is "
407
"paramount that for the future of your bot that you upgrade your code to "
408
"the new way things are done."
409
msgstr ""
410

411
#: ../../intents.rst:191
412
msgid "To downgrade you can do the following:"
413
msgstr ""
414

415
#: ../../intents.rst:197
416
msgid "On Windows use ``py -3`` instead of ``python3``."
417
msgstr ""
418

419
#: ../../intents.rst:201
420
msgid ""
421
"There is no currently set date in which the old gateway will stop working"
422
" so it is recommended to update your code instead."
423
msgstr ""
424

425
#: ../../intents.rst:203
426
msgid ""
427
"If you truly dislike the direction Discord is going with their API, you "
428
"can contact them via `support <https://dis.gd/contact>`_"
429
msgstr ""
430

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.