scurrypy 0.4__py3-none-any.whl → 0.6.6__py3-none-any.whl
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.
- scurrypy/__init__.py +429 -0
- scurrypy/client.py +335 -0
- {discord → scurrypy}/client_like.py +8 -1
- scurrypy/dispatch/command_dispatcher.py +205 -0
- {discord → scurrypy}/dispatch/event_dispatcher.py +21 -21
- {discord → scurrypy}/dispatch/prefix_dispatcher.py +31 -12
- {discord → scurrypy}/error.py +6 -18
- {discord → scurrypy}/events/channel_events.py +2 -1
- scurrypy/events/gateway_events.py +31 -0
- {discord → scurrypy}/events/guild_events.py +2 -1
- {discord → scurrypy}/events/interaction_events.py +28 -13
- {discord → scurrypy}/events/message_events.py +8 -5
- {discord → scurrypy}/events/reaction_events.py +1 -2
- {discord → scurrypy}/events/ready_event.py +1 -3
- scurrypy/gateway.py +183 -0
- scurrypy/http.py +310 -0
- {discord → scurrypy}/intents.py +5 -7
- {discord → scurrypy}/logger.py +14 -61
- scurrypy/model.py +71 -0
- scurrypy/models.py +258 -0
- scurrypy/parts/channel.py +42 -0
- scurrypy/parts/command.py +90 -0
- scurrypy/parts/components.py +224 -0
- scurrypy/parts/components_v2.py +144 -0
- scurrypy/parts/embed.py +83 -0
- scurrypy/parts/message.py +134 -0
- scurrypy/parts/modal.py +16 -0
- {discord → scurrypy}/parts/role.py +2 -14
- {discord → scurrypy}/resources/application.py +1 -2
- {discord → scurrypy}/resources/bot_emojis.py +1 -1
- {discord → scurrypy}/resources/channel.py +9 -8
- {discord → scurrypy}/resources/guild.py +14 -16
- {discord → scurrypy}/resources/interaction.py +50 -43
- {discord → scurrypy}/resources/message.py +15 -16
- {discord → scurrypy}/resources/user.py +3 -4
- scurrypy-0.6.6.dist-info/METADATA +108 -0
- scurrypy-0.6.6.dist-info/RECORD +47 -0
- {scurrypy-0.4.dist-info → scurrypy-0.6.6.dist-info}/licenses/LICENSE +1 -1
- scurrypy-0.6.6.dist-info/top_level.txt +1 -0
- discord/__init__.py +0 -223
- discord/client.py +0 -375
- discord/dispatch/command_dispatcher.py +0 -163
- discord/gateway.py +0 -155
- discord/http.py +0 -280
- discord/model.py +0 -90
- discord/models/__init__.py +0 -1
- discord/models/application.py +0 -37
- discord/models/emoji.py +0 -34
- discord/models/guild.py +0 -35
- discord/models/integration.py +0 -23
- discord/models/interaction.py +0 -26
- discord/models/member.py +0 -27
- discord/models/role.py +0 -53
- discord/models/user.py +0 -15
- discord/parts/action_row.py +0 -208
- discord/parts/channel.py +0 -20
- discord/parts/command.py +0 -102
- discord/parts/components_v2.py +0 -353
- discord/parts/embed.py +0 -154
- discord/parts/message.py +0 -194
- discord/parts/modal.py +0 -21
- scurrypy-0.4.dist-info/METADATA +0 -130
- scurrypy-0.4.dist-info/RECORD +0 -54
- scurrypy-0.4.dist-info/top_level.txt +0 -1
- {discord → scurrypy}/config.py +0 -0
- {discord → scurrypy}/dispatch/__init__.py +0 -0
- {discord → scurrypy}/events/__init__.py +0 -0
- {discord → scurrypy}/events/hello_event.py +0 -0
- {discord → scurrypy}/parts/__init__.py +0 -0
- {discord → scurrypy}/parts/component_types.py +0 -0
- {discord → scurrypy}/resources/__init__.py +0 -0
- {scurrypy-0.4.dist-info → scurrypy-0.6.6.dist-info}/WHEEL +0 -0
scurrypy/__init__.py
ADDED
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
# scurrypy
|
|
2
|
+
|
|
3
|
+
import importlib
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
# top-level modules
|
|
8
|
+
"Logger", "Client", "Intents", "set_intents", "BaseConfig",
|
|
9
|
+
|
|
10
|
+
# events
|
|
11
|
+
"InteractionTypes", "ReadyEvent",
|
|
12
|
+
"ReactionAddEvent", "ReactionRemoveEvent", "ReactionRemoveEmojiEvent", "ReactionRemoveAllEvent",
|
|
13
|
+
"GuildCreateEvent", "GuildUpdateEvent", "GuildDeleteEvent",
|
|
14
|
+
"MessageCreateEvent", "MessageUpdateEvent", "MessageDeleteEvent",
|
|
15
|
+
"GuildChannelCreateEvent", "GuildChannelUpdateEvent", "GuildChannelDeleteEvent", "ChannelPinsUpdateEvent",
|
|
16
|
+
"InteractionEvent",
|
|
17
|
+
|
|
18
|
+
# models
|
|
19
|
+
"UserModel", "EmojiModel", "GuildModel", "ApplicationModel", "ReadyGuildModel", "IntegrationModel",
|
|
20
|
+
"InteractionCallbackDataModel", "InteractionCallbackModel", "MemberModel", "RoleColors", "RoleModel",
|
|
21
|
+
|
|
22
|
+
# parts
|
|
23
|
+
"ChannelTypes", "GuildChannel",
|
|
24
|
+
"CommandTypes", "CommandOptionTypes", "SlashCommand", "UserCommand", "MessageCommand",
|
|
25
|
+
"ComponentV2Types", "SectionPart", "TextDisplay", "Thumbnail", "MediaGalleryItem", "MediaGallery",
|
|
26
|
+
"File", "SeparatorTypes", "Separator", "ContainerPart", "Label",
|
|
27
|
+
"ComponentTypes", "ActionRowPart", "ButtonStyles", "Button", "SelectOption", "StringSelect",
|
|
28
|
+
"TextInputStyles", "TextInput", "DefaultValue", "UserSelect", "RoleSelect", "MentionableSelect",
|
|
29
|
+
"ChannelSelect",
|
|
30
|
+
"EmbedAuthor", "EmbedThumbnail", "EmbedField", "EmbedImage", "EmbedFooter", "EmbedPart",
|
|
31
|
+
"MessageFlags", "MessageReferenceTypes", "MessageReference", "Attachment", "MessagePart", "Role", "ModalPart",
|
|
32
|
+
|
|
33
|
+
# resources
|
|
34
|
+
"ApplicationFlags", "Application",
|
|
35
|
+
"BotEmojis",
|
|
36
|
+
"PinnedMessage", "Channel",
|
|
37
|
+
"Guild",
|
|
38
|
+
"InteractionCallbackTypes", "Interaction",
|
|
39
|
+
"Message",
|
|
40
|
+
"User",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
# For editor support / autocomplete
|
|
44
|
+
if TYPE_CHECKING:
|
|
45
|
+
from .logger import Logger
|
|
46
|
+
from .client import Client
|
|
47
|
+
from .intents import Intents, set_intents
|
|
48
|
+
from .config import BaseConfig
|
|
49
|
+
|
|
50
|
+
from .dispatch.command_dispatcher import InteractionTypes
|
|
51
|
+
|
|
52
|
+
# events
|
|
53
|
+
from .events.ready_event import ReadyEvent
|
|
54
|
+
from .events.reaction_events import (
|
|
55
|
+
ReactionAddEvent,
|
|
56
|
+
ReactionRemoveEvent,
|
|
57
|
+
ReactionRemoveEmojiEvent,
|
|
58
|
+
ReactionRemoveAllEvent,
|
|
59
|
+
)
|
|
60
|
+
from .events.guild_events import (
|
|
61
|
+
GuildCreateEvent,
|
|
62
|
+
GuildUpdateEvent,
|
|
63
|
+
GuildDeleteEvent,
|
|
64
|
+
)
|
|
65
|
+
from .events.message_events import (
|
|
66
|
+
MessageCreateEvent,
|
|
67
|
+
MessageUpdateEvent,
|
|
68
|
+
MessageDeleteEvent,
|
|
69
|
+
)
|
|
70
|
+
from .events.channel_events import (
|
|
71
|
+
GuildChannelCreateEvent,
|
|
72
|
+
GuildChannelUpdateEvent,
|
|
73
|
+
GuildChannelDeleteEvent,
|
|
74
|
+
ChannelPinsUpdateEvent,
|
|
75
|
+
)
|
|
76
|
+
from .events.interaction_events import InteractionEvent
|
|
77
|
+
|
|
78
|
+
# models
|
|
79
|
+
from .models import (
|
|
80
|
+
UserModel,
|
|
81
|
+
EmojiModel,
|
|
82
|
+
GuildModel,
|
|
83
|
+
ApplicationModel,
|
|
84
|
+
ReadyGuildModel,
|
|
85
|
+
IntegrationModel,
|
|
86
|
+
InteractionCallbackDataModel,
|
|
87
|
+
InteractionCallbackModel,
|
|
88
|
+
MemberModel,
|
|
89
|
+
RoleColors,
|
|
90
|
+
RoleModel
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# parts
|
|
94
|
+
from .parts.channel import (
|
|
95
|
+
ChannelTypes,
|
|
96
|
+
GuildChannel
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
from .parts.command import (
|
|
100
|
+
CommandTypes,
|
|
101
|
+
CommandOptionTypes,
|
|
102
|
+
SlashCommand,
|
|
103
|
+
UserCommand,
|
|
104
|
+
MessageCommand
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
from .parts.components_v2 import (
|
|
108
|
+
ComponentV2Types,
|
|
109
|
+
SectionPart,
|
|
110
|
+
TextDisplay,
|
|
111
|
+
Thumbnail,
|
|
112
|
+
MediaGalleryItem,
|
|
113
|
+
MediaGallery,
|
|
114
|
+
File,
|
|
115
|
+
SeparatorTypes,
|
|
116
|
+
Separator,
|
|
117
|
+
ContainerPart,
|
|
118
|
+
Label
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
from .parts.components import (
|
|
122
|
+
ComponentTypes,
|
|
123
|
+
ActionRowPart,
|
|
124
|
+
ButtonStyles,
|
|
125
|
+
Button,
|
|
126
|
+
SelectOption,
|
|
127
|
+
StringSelect,
|
|
128
|
+
TextInputStyles,
|
|
129
|
+
TextInput,
|
|
130
|
+
DefaultValue,
|
|
131
|
+
# SelectMenu,
|
|
132
|
+
UserSelect,
|
|
133
|
+
RoleSelect,
|
|
134
|
+
MentionableSelect,
|
|
135
|
+
ChannelSelect
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
from .parts.embed import (
|
|
139
|
+
EmbedAuthor,
|
|
140
|
+
EmbedThumbnail,
|
|
141
|
+
EmbedField,
|
|
142
|
+
EmbedImage,
|
|
143
|
+
EmbedFooter,
|
|
144
|
+
EmbedPart
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
from .parts.message import (
|
|
148
|
+
MessageFlags,
|
|
149
|
+
# MessageFlagParams,
|
|
150
|
+
MessageReferenceTypes,
|
|
151
|
+
MessageReference,
|
|
152
|
+
Attachment,
|
|
153
|
+
MessagePart
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
from .parts.modal import ModalPart
|
|
157
|
+
from .parts.role import Role
|
|
158
|
+
|
|
159
|
+
# resources
|
|
160
|
+
from .resources.application import (
|
|
161
|
+
ApplicationFlags,
|
|
162
|
+
Application
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
from .resources.bot_emojis import BotEmojis
|
|
166
|
+
|
|
167
|
+
from .resources.channel import (
|
|
168
|
+
# MessagesFetchParams,
|
|
169
|
+
# PinsFetchParams,
|
|
170
|
+
# ThreadFromMessageParams,
|
|
171
|
+
PinnedMessage,
|
|
172
|
+
Channel
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
from .resources.guild import (
|
|
176
|
+
# FetchGuildMembersParams,
|
|
177
|
+
# FetchGuildParams,
|
|
178
|
+
Guild
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
from .resources.interaction import (
|
|
182
|
+
# InteractionDataTypes,
|
|
183
|
+
InteractionCallbackTypes,
|
|
184
|
+
Interaction
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
from .resources.message import Message
|
|
188
|
+
|
|
189
|
+
from .resources.user import (
|
|
190
|
+
# FetchUserGuildsParams,
|
|
191
|
+
User
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
_lazy_modules = [
|
|
195
|
+
# top-level modules
|
|
196
|
+
(
|
|
197
|
+
"scurrypy.logger",
|
|
198
|
+
[
|
|
199
|
+
"Logger"
|
|
200
|
+
]
|
|
201
|
+
),
|
|
202
|
+
(
|
|
203
|
+
"scurrypy.client",
|
|
204
|
+
[
|
|
205
|
+
"Client"
|
|
206
|
+
]
|
|
207
|
+
),
|
|
208
|
+
(
|
|
209
|
+
"scurrypy.intents",
|
|
210
|
+
[
|
|
211
|
+
"Intents",
|
|
212
|
+
"set_intents"
|
|
213
|
+
]
|
|
214
|
+
),
|
|
215
|
+
(
|
|
216
|
+
"scurrypy.config",
|
|
217
|
+
[
|
|
218
|
+
"BaseConfig"
|
|
219
|
+
]
|
|
220
|
+
),
|
|
221
|
+
(
|
|
222
|
+
"scurrypy.models",
|
|
223
|
+
[
|
|
224
|
+
"UserModel",
|
|
225
|
+
"EmojiModel",
|
|
226
|
+
"GuildModel",
|
|
227
|
+
"ApplicationModel",
|
|
228
|
+
"ReadyGuildModel",
|
|
229
|
+
"IntegrationModel",
|
|
230
|
+
"InteractionCallbackDataModel",
|
|
231
|
+
"InteractionCallbackModel",
|
|
232
|
+
"MemberModel",
|
|
233
|
+
"RoleColors",
|
|
234
|
+
"RoleModel"
|
|
235
|
+
]
|
|
236
|
+
),
|
|
237
|
+
|
|
238
|
+
# Events
|
|
239
|
+
(
|
|
240
|
+
"scurrypy.events.ready_event",
|
|
241
|
+
[
|
|
242
|
+
"ReadyEvent"
|
|
243
|
+
]
|
|
244
|
+
),
|
|
245
|
+
(
|
|
246
|
+
"scurrypy.events.reaction_events",
|
|
247
|
+
[
|
|
248
|
+
"ReactionAddEvent",
|
|
249
|
+
"ReactionRemoveEvent",
|
|
250
|
+
"ReactionRemoveEmojiEvent",
|
|
251
|
+
"ReactionRemoveAllEvent"
|
|
252
|
+
]
|
|
253
|
+
),
|
|
254
|
+
(
|
|
255
|
+
"scurrypy.events.guild_events",
|
|
256
|
+
[
|
|
257
|
+
"GuildCreateEvent",
|
|
258
|
+
"GuildUpdateEvent",
|
|
259
|
+
"GuildDeleteEvent"
|
|
260
|
+
]
|
|
261
|
+
),
|
|
262
|
+
(
|
|
263
|
+
"scurrypy.events.message_events",
|
|
264
|
+
[
|
|
265
|
+
"MessageCreateEvent",
|
|
266
|
+
"MessageUpdateEvent",
|
|
267
|
+
"MessageDeleteEvent"
|
|
268
|
+
]
|
|
269
|
+
),
|
|
270
|
+
(
|
|
271
|
+
"scurrypy.events.channel_events",
|
|
272
|
+
[
|
|
273
|
+
"GuildChannelCreateEvent",
|
|
274
|
+
"GuildChannelUpdateEvent",
|
|
275
|
+
"GuildChannelDeleteEvent",
|
|
276
|
+
"ChannelPinsUpdateEvent"
|
|
277
|
+
]
|
|
278
|
+
),
|
|
279
|
+
(
|
|
280
|
+
"scurrypy.events.interaction_events",
|
|
281
|
+
[
|
|
282
|
+
"InteractionEvent"
|
|
283
|
+
]
|
|
284
|
+
),
|
|
285
|
+
|
|
286
|
+
# Parts
|
|
287
|
+
(
|
|
288
|
+
"scurrypy.parts.channel",
|
|
289
|
+
[
|
|
290
|
+
"ChannelTypes",
|
|
291
|
+
"GuildChannel"
|
|
292
|
+
]
|
|
293
|
+
),
|
|
294
|
+
(
|
|
295
|
+
"scurrypy.parts.command",
|
|
296
|
+
[
|
|
297
|
+
"CommandTypes",
|
|
298
|
+
"CommandOptionTypes",
|
|
299
|
+
"SlashCommand",
|
|
300
|
+
"UserCommand",
|
|
301
|
+
"MessageCommand"
|
|
302
|
+
]
|
|
303
|
+
),
|
|
304
|
+
(
|
|
305
|
+
"scurrypy.parts.components_v2",
|
|
306
|
+
[
|
|
307
|
+
"ComponentV2Types",
|
|
308
|
+
"SectionPart",
|
|
309
|
+
"TextDisplay",
|
|
310
|
+
"Thumbnail",
|
|
311
|
+
"MediaGalleryItem",
|
|
312
|
+
"MediaGallery",
|
|
313
|
+
"File",
|
|
314
|
+
"SeparatorTypes",
|
|
315
|
+
"Separator",
|
|
316
|
+
"ContainerPart",
|
|
317
|
+
"Label"
|
|
318
|
+
]
|
|
319
|
+
),
|
|
320
|
+
(
|
|
321
|
+
"scurrypy.parts.components",
|
|
322
|
+
[
|
|
323
|
+
"ComponentTypes",
|
|
324
|
+
"ActionRowPart",
|
|
325
|
+
"ButtonStyles",
|
|
326
|
+
"Button",
|
|
327
|
+
"SelectOption",
|
|
328
|
+
"StringSelect",
|
|
329
|
+
"TextInputStyles",
|
|
330
|
+
"TextInput",
|
|
331
|
+
"DefaultValue",
|
|
332
|
+
"UserSelect",
|
|
333
|
+
"RoleSelect",
|
|
334
|
+
"MentionableSelect",
|
|
335
|
+
"ChannelSelect"
|
|
336
|
+
]
|
|
337
|
+
),
|
|
338
|
+
(
|
|
339
|
+
"scurrypy.parts.embed",
|
|
340
|
+
[
|
|
341
|
+
"EmbedAuthor",
|
|
342
|
+
"EmbedThumbnail",
|
|
343
|
+
"EmbedField",
|
|
344
|
+
"EmbedImage",
|
|
345
|
+
"EmbedFooter",
|
|
346
|
+
"EmbedPart"
|
|
347
|
+
]
|
|
348
|
+
),
|
|
349
|
+
(
|
|
350
|
+
"scurrypy.parts.message",
|
|
351
|
+
[
|
|
352
|
+
"MessageFlags",
|
|
353
|
+
"MessageReferenceTypes",
|
|
354
|
+
"MessageReference",
|
|
355
|
+
"Attachment",
|
|
356
|
+
"MessagePart"
|
|
357
|
+
]
|
|
358
|
+
),
|
|
359
|
+
(
|
|
360
|
+
"scurrypy.parts.modal",
|
|
361
|
+
[
|
|
362
|
+
"ModalPart"
|
|
363
|
+
]
|
|
364
|
+
),
|
|
365
|
+
|
|
366
|
+
# resources
|
|
367
|
+
(
|
|
368
|
+
"scurrypy.resources.application",
|
|
369
|
+
[
|
|
370
|
+
"ApplicationFlags",
|
|
371
|
+
"Application"
|
|
372
|
+
]
|
|
373
|
+
),
|
|
374
|
+
(
|
|
375
|
+
"scurrypy.resources.bot_emojis",
|
|
376
|
+
[
|
|
377
|
+
"BotEmojis"
|
|
378
|
+
]
|
|
379
|
+
),
|
|
380
|
+
(
|
|
381
|
+
"scurrypy.resources.channel",
|
|
382
|
+
[
|
|
383
|
+
"PinnedMessage",
|
|
384
|
+
"Channel"
|
|
385
|
+
]
|
|
386
|
+
),
|
|
387
|
+
(
|
|
388
|
+
"scurrypy.resources.guild",
|
|
389
|
+
[
|
|
390
|
+
"Guild"
|
|
391
|
+
]
|
|
392
|
+
),
|
|
393
|
+
(
|
|
394
|
+
"scurrypy.resources.interaction",
|
|
395
|
+
[
|
|
396
|
+
"InteractionCallbackTypes",
|
|
397
|
+
"Interaction"
|
|
398
|
+
]
|
|
399
|
+
),
|
|
400
|
+
(
|
|
401
|
+
"scurrypy.resources.message",
|
|
402
|
+
[
|
|
403
|
+
"Message"
|
|
404
|
+
]
|
|
405
|
+
),
|
|
406
|
+
(
|
|
407
|
+
"scurrypy.resources.user",
|
|
408
|
+
[
|
|
409
|
+
"User"
|
|
410
|
+
]
|
|
411
|
+
)
|
|
412
|
+
]
|
|
413
|
+
|
|
414
|
+
_mapping = {name: module_path
|
|
415
|
+
for module_path, names in _lazy_modules
|
|
416
|
+
for name in names
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
def __getattr__(name: str):
|
|
420
|
+
if name not in _mapping:
|
|
421
|
+
raise AttributeError(f"module {__name__} has no attribute {name}")
|
|
422
|
+
|
|
423
|
+
module = importlib.import_module(_mapping[name])
|
|
424
|
+
attr = getattr(module, name)
|
|
425
|
+
globals()[name] = attr # cache it for future lookups
|
|
426
|
+
return attr
|
|
427
|
+
|
|
428
|
+
def __dir__():
|
|
429
|
+
return sorted(list(globals().keys()) + __all__)
|