-
Notifications
You must be signed in to change notification settings - Fork 188
/
guild.pyi
539 lines (521 loc) · 15.9 KB
/
guild.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
from datetime import datetime
from typing import Any, List, Optional, Union, Dict
from enum import IntEnum
from .channel import Channel, ChannelType, Thread
from .member import Member
from .message import Emoji, Sticker
from .misc import DictSerializerMixin, MISSING, Snowflake, Overwrite, Image
from .presence import PresenceActivity
from .role import Role
from .user import User
from ..http.client import HTTPClient
class VerificationLevel(IntEnum):
NONE: int
LOW: int
MEDIUM: int
HIGH: int
VERY_HIGH: int
class ExplicitContentFilterLevel(IntEnum):
DISABLED: int
MEMBERS_WITHOUT_ROLES: int
ALL_MEMBERS: int
class DefaultMessageNotificationLevel(IntEnum):
ALL_MESSAGES: int
ONLY_MENTIONS: int
class EntityType(IntEnum):
STAGE_INSTANCE: int
VOICE: int
EXTERNAL: int
class EventStatus(IntEnum):
SCHEDULED: int
ACTIVE: int
COMPLETED: int
CANCELED: int
class InviteTargetType(IntEnum):
STREAM: int
EMBEDDED_APPLICATION: int
class WelcomeChannels(DictSerializerMixin):
_json: dict
channel_id: int
description: str
emoji_id: Optional[Snowflake]
emoji_name: Optional[str]
def __init__(self, **kwargs): ...
class WelcomeScreen(DictSerializerMixin):
_json: dict
description: Optional[str]
welcome_channels: List[WelcomeChannels]
def __init__(self, **kwargs): ...
class StageInstance(DictSerializerMixin):
_json: dict
id: int
guild_id: int
channel_id: int
topic: str
privacy_level: int # can be Enum'd
discoverable_disabled: bool
def __init__(self, **kwargs): ...
class UnavailableGuild(DictSerializerMixin):
_json: dict
id: Snowflake
unavailable: bool
def __init__(self, **kwargs): ...
class Guild(DictSerializerMixin):
_json: dict
_client: HTTPClient
id: Snowflake
name: str
icon: Optional[str]
icon_hash: Optional[str]
splash: Optional[str]
discovery_splash: Optional[str]
owner: Optional[bool]
owner_id: int
permissions: Optional[str]
region: Optional[str] # None, we don't do Voices.
afk_channel_id: Optional[Snowflake]
afk_timeout: int
widget_enabled: Optional[bool]
widget_channel_id: Optional[Snowflake]
verification_level: int
default_message_notifications: int
explicit_content_filter: int
roles: List[Role]
emojis: List[Emoji]
mfa_level: int
application_id: Optional[Snowflake]
system_channel_id: Optional[Snowflake]
system_channel_flags: int
rules_channel_id: Optional[Snowflake]
joined_at: Optional[datetime]
large: Optional[bool]
unavailable: Optional[bool]
member_count: Optional[int]
members: Optional[List[Member]]
channels: Optional[List[Channel]]
threads: Optional[List[Thread]] # threads, because of their metadata
presences: Optional[List[PresenceActivity]]
max_presences: Optional[int]
max_members: Optional[int]
vanity_url_code: Optional[str]
description: Optional[str]
banner: Optional[str]
premium_tier: int
premium_subscription_count: Optional[int]
preferred_locale: str
public_updates_channel_id: Optional[Snowflake]
max_video_channel_users: Optional[int]
approximate_member_count: Optional[int]
approximate_presence_count: Optional[int]
welcome_screen: Optional[WelcomeScreen]
nsfw_level: int
stage_instances: Optional[List[StageInstance]]
stickers: Optional[List[Sticker]]
# TODO: post-v4: Investigate all of these once Discord has them all documented.
guild_hashes: Any
embedded_activities: Any
guild_scheduled_events: Any
nsfw: Any
application_command_count: Any
premium_progress_bar_enabled: Any
hub_type: Any
lazy: Any
application_command_counts: Any
def __init__(self, **kwargs): ...
def __repr__(self) -> str: ...
async def ban(
self,
member_id: int,
reason: Optional[str] = None,
delete_message_days: Optional[int] = 0,
) -> None: ...
async def remove_ban(
self,
user_id: int,
reason: Optional[str] = None,
) -> None: ...
async def kick(
self,
member_id: int,
reason: Optional[str] = None,
) -> None: ...
async def add_member_role(
self,
role: Union[Role, int],
member_id: int,
reason: Optional[str] = None,
) -> None: ...
async def remove_member_role(
self,
role: Union[Role, int],
member_id: int,
reason: Optional[str] = None,
) -> None: ...
async def create_role(
self,
name: str,
# permissions,
color: Optional[int] = 0,
hoist: Optional[bool] = False,
# icon,
# unicode_emoji,
mentionable: Optional[bool] = False,
reason: Optional[str] = None,
) -> Role: ...
async def get_member(
self,
member_id: int,
) -> Member: ...
async def delete_channel(
self,
channel_id: int,
) -> None: ...
async def delete_role(
self,
role_id: int,
reason: Optional[str] = None,
) -> None: ...
async def modify_role(
self,
role_id: int,
name: Optional[str] = MISSING,
# permissions,
color: Optional[int] = MISSING,
hoist: Optional[bool] = MISSING,
# icon,
# unicode_emoji,
mentionable: Optional[bool] = MISSING,
reason: Optional[str] = None,
) -> Role: ...
async def create_thread(
self,
name: str,
channel_id: int,
type: Optional[ChannelType] = ChannelType.GUILD_PUBLIC_THREAD,
auto_archive_duration: Optional[int] = MISSING,
invitable: Optional[bool] = MISSING,
message_id: Optional[int] = MISSING,
reason: Optional[str] = None,
) -> Channel: ...
async def create_channel(
self,
name: str,
type: ChannelType,
topic: Optional[str] = MISSING,
bitrate: Optional[int] = MISSING,
user_limit: Optional[int] = MISSING,
rate_limit_per_user: Optional[int] = MISSING,
position: Optional[int] = MISSING,
permission_overwrites: Optional[List[Overwrite]] = MISSING,
parent_id: Optional[int] = MISSING,
nsfw: Optional[bool] = MISSING,
reason: Optional[str] = None,
) -> Channel: ...
async def clone_channel(
self,
channel_id: int
) -> Channel: ...
async def modify_channel(
self,
channel_id: int,
name: Optional[str] = MISSING,
topic: Optional[str] = MISSING,
bitrate: Optional[int] = MISSING,
user_limit: Optional[int] = MISSING,
rate_limit_per_user: Optional[int] = MISSING,
position: Optional[int] = MISSING,
permission_overwrites: Optional[List[Overwrite]] = MISSING,
parent_id: Optional[int] = MISSING,
nsfw: Optional[bool] = MISSING,
archived: Optional[bool] = MISSING,
auto_archive_duration: Optional[int] = MISSING,
locked: Optional[bool] = MISSING,
reason: Optional[str] = None,
) -> Channel: ...
async def modify_member(
self,
member_id: int,
nick: Optional[str] = MISSING,
roles: Optional[List[int]] = MISSING,
mute: Optional[bool] = MISSING,
deaf: Optional[bool] = MISSING,
channel_id: Optional[int] = MISSING,
communication_disabled_until: Optional[datetime.isoformat] = MISSING,
reason: Optional[str] = None,
) -> Member: ...
async def get_preview(self) -> GuildPreview: ...
async def leave(self) -> None: ...
async def modify(
self,
name: Optional[str] = MISSING,
verification_level: Optional[VerificationLevel] = MISSING,
default_message_notifications: Optional[DefaultMessageNotificationLevel] = MISSING,
explicit_content_filter: Optional[ExplicitContentFilterLevel] = MISSING,
afk_channel_id: Optional[int] = MISSING,
afk_timeout: Optional[int] = MISSING,
icon: Optional[Image] = MISSING,
owner_id: Optional[int] = MISSING,
splash: Optional[Image] = MISSING,
discovery_splash: Optional[Image] = MISSING,
banner: Optional[Image] = MISSING,
system_channel_id: Optional[int] = MISSING,
suppress_join_notifications: Optional[bool] = MISSING,
suppress_premium_subscriptions: Optional[bool] = MISSING,
suppress_guild_reminder_notifications: Optional[bool] = MISSING,
suppress_join_notification_replies: Optional[bool] = MISSING,
rules_channel_id: Optional[int] = MISSING,
public_updates_channel_id: Optional[int] = MISSING,
preferred_locale: Optional[str] = MISSING,
description: Optional[str] = MISSING,
premium_progress_bar_enabled: Optional[bool] = MISSING,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_name(
self,
name: str,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_verification_level(
self,
verification_level: VerificationLevel,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_default_message_notifications(
self,
default_message_notifications: DefaultMessageNotificationLevel,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_explicit_content_filter(
self,
explicit_content_filter: ExplicitContentFilterLevel,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_afk_channel(
self,
afk_channel_id: int,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_afk_timeout(
self,
afk_timeout: int,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_system_channel(
self,
system_channel_id: int,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_rules_channel(
self,
rules_channel_id: int,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_public_updates_channel(
self,
public_updates_channel_id: int,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_preferred_locale(
self,
preferred_locale: str,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_description(
self,
description: str,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_premium_progress_bar_enabled(
self,
premium_progress_bar_enabled: bool,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_icon(
self,
icon: Image,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_splash(
self,
splash: Image,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_discovery_splash(
self,
discovery_splash: Image,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def set_banner(
self,
banner: Image,
*,
reason: Optional[str] = None,
) -> "Guild": ...
async def create_scheduled_event(
self,
name: str,
entity_type: EntityType,
scheduled_start_time: datetime.isoformat,
scheduled_end_time: Optional[datetime.isoformat] = MISSING,
entity_metadata: Optional["EventMetadata"] = MISSING,
channel_id: Optional[int] = MISSING,
description: Optional[str] = MISSING,
image: Optional[Image] = MISSING,
# privacy_level, TODO: implement when more levels available
) -> "ScheduledEvents": ...
async def modify_scheduled_event(
self,
event_id: int,
name: Optional[str] = MISSING,
entity_type: Optional[EntityType] = MISSING,
scheduled_start_time: Optional[datetime.isoformat] = MISSING,
scheduled_end_time: Optional[datetime.isoformat] = MISSING,
entity_metadata: Optional["EventMetadata"] = MISSING,
channel_id: Optional[int] = MISSING,
description: Optional[str] = MISSING,
image: Optional[Image] = MISSING,
# privacy_level, TODO: implement when more levels available
) -> "ScheduledEvents": ...
async def delete_scheduled_event(
self,
event_id: int
) -> None: ...
async def get_all_channels(self) -> List[Channel]: ...
async def get_all_roles(self) -> List[Role]: ...
async def get_role(
self,
role_id: int,
) -> Role: ...
async def modify_role_position(
self,
role_id: Union[Role, int],
position: int,
reason: Optional[str] = None,
) -> List[Role]: ...
async def modify_role_positions(
self,
changes: List[dict],
reason: Optional[str] = None,
) -> List[Role]: ...
async def get_bans(
self,
limit: Optional[int] = 1000,
before: Optional[int] = None,
after: Optional[int] = None,
) -> List[dict]: ...
async def get_all_bans(self) -> List[Dict[str, User]]: ...
async def get_emoji(
self,
emoji_id: int
) -> Emoji: ...
async def get_all_emoji(self) -> List[Emoji]: ...
async def create_emoji(
self,
image: Image,
name: Optional[str] = MISSING,
roles: Optional[Union[List[Role], List[int]]] = MISSING,
reason: Optional[str] = None,
) -> Emoji: ...
async def delete_emoji(
self,
emoji: Union[Emoji, int],
reason: Optional[str] = None,
) -> None: ...
async def get_list_of_members(
self,
limit: Optional[int] = 1,
after: Optional[Union[Member, int]] = MISSING,
) -> List[Member]: ...
async def search_members(
self,
query: str,
limit: Optional[int] = 1
) -> List[Member]: ...
async def get_all_members(self) -> List[Member]: ...
@property
def icon_url(self) -> Optional[str]: ...
@property
def banner_url(self) -> Optional[str]: ...
@property
def splash_url(self) -> Optional[str]: ...
@property
def discovery_splash_url(self) -> Optional[str]: ...
class GuildPreview(DictSerializerMixin):
_json: dict
id: int
name: str
icon: Optional[str]
splash: Optional[str]
discovery_splash: Optional[str]
emoji: List[Emoji]
approximate_member_count: int
approximate_presence_count: int
description: Optional[str]
def __init__(self, **kwargs): ...
class Invite(DictSerializerMixin):
_json: dict
_client: HTTPClient
type: str
guild_id: Snowflake
expires_at: Optional[datetime]
code: str
channel_id: Snowflake
uses: int
max_uses: int
max_age: int
temporary: bool
created_at: datetime
def __init__(self, **kwargs): ...
async def delete(self) -> None: ...
class GuildTemplate(DictSerializerMixin):
_json: dict
code: str
name: str
description: Optional[str]
usage_count: int
creator_id: int
creator: User
created_at: datetime
updated_at: datetime
source_guild_id: int
serialized_source_guild: Guild # partial
is_dirty: Optional[bool]
def __init__(self, **kwargs): ...
class EventMetadata(DictSerializerMixin):
_json: dict
location: Optional[str]
def __init__(self, **kwargs): ...
class ScheduledEvents(DictSerializerMixin):
_json: dict
id: Snowflake
guild_id: Snowflake
channel_id: Optional[Snowflake]
creator_id: Optional[Snowflake]
name: str
description: str
scheduled_start_time: datetime
scheduled_end_time: Optional[datetime]
privacy_level: int
entity_type: int
entity_id: Optional[Snowflake]
entity_metadata: Optional[EventMetadata]
creator: Optional[User]
user_count: Optional[int]
status: int
image: Optional[str]
def __init__(self, **kwargs): ...