scurrypy 0.4.2__py3-none-any.whl → 0.5.3__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.

Potentially problematic release.


This version of scurrypy might be problematic. Click here for more details.

Files changed (65) hide show
  1. scurrypy/__init__.py +376 -0
  2. {discord → scurrypy}/client_like.py +1 -1
  3. {discord → scurrypy}/dispatch/command_dispatcher.py +13 -5
  4. {discord → scurrypy}/dispatch/event_dispatcher.py +15 -15
  5. {discord → scurrypy}/events/channel_events.py +1 -1
  6. {discord → scurrypy}/events/interaction_events.py +21 -9
  7. {discord → scurrypy}/events/message_events.py +4 -4
  8. {discord → scurrypy}/http.py +1 -1
  9. {discord → scurrypy}/intents.py +1 -1
  10. scurrypy/model.py +71 -0
  11. {discord → scurrypy}/models/emoji.py +17 -1
  12. {discord → scurrypy}/models/interaction.py +5 -0
  13. scurrypy/parts/channel.py +42 -0
  14. scurrypy/parts/command.py +90 -0
  15. scurrypy/parts/components.py +224 -0
  16. scurrypy/parts/components_v2.py +144 -0
  17. scurrypy/parts/embed.py +83 -0
  18. scurrypy/parts/message.py +137 -0
  19. scurrypy/parts/modal.py +16 -0
  20. {discord → scurrypy}/parts/role.py +1 -13
  21. {discord → scurrypy}/resources/channel.py +6 -6
  22. {discord → scurrypy}/resources/guild.py +3 -4
  23. {discord → scurrypy}/resources/interaction.py +23 -22
  24. {discord → scurrypy}/resources/message.py +13 -13
  25. {scurrypy-0.4.2.dist-info → scurrypy-0.5.3.dist-info}/METADATA +19 -25
  26. scurrypy-0.5.3.dist-info/RECORD +54 -0
  27. scurrypy-0.5.3.dist-info/top_level.txt +1 -0
  28. discord/__init__.py +0 -223
  29. discord/model.py +0 -90
  30. discord/parts/action_row.py +0 -208
  31. discord/parts/channel.py +0 -20
  32. discord/parts/command.py +0 -102
  33. discord/parts/components_v2.py +0 -353
  34. discord/parts/embed.py +0 -154
  35. discord/parts/message.py +0 -194
  36. discord/parts/modal.py +0 -21
  37. scurrypy-0.4.2.dist-info/RECORD +0 -54
  38. scurrypy-0.4.2.dist-info/top_level.txt +0 -1
  39. {discord → scurrypy}/client.py +0 -0
  40. {discord → scurrypy}/config.py +0 -0
  41. {discord → scurrypy}/dispatch/__init__.py +0 -0
  42. {discord → scurrypy}/dispatch/prefix_dispatcher.py +0 -0
  43. {discord → scurrypy}/error.py +0 -0
  44. {discord → scurrypy}/events/__init__.py +0 -0
  45. {discord → scurrypy}/events/guild_events.py +0 -0
  46. {discord → scurrypy}/events/hello_event.py +0 -0
  47. {discord → scurrypy}/events/reaction_events.py +0 -0
  48. {discord → scurrypy}/events/ready_event.py +0 -0
  49. {discord → scurrypy}/gateway.py +0 -0
  50. {discord → scurrypy}/logger.py +0 -0
  51. {discord → scurrypy}/models/__init__.py +0 -0
  52. {discord → scurrypy}/models/application.py +0 -0
  53. {discord → scurrypy}/models/guild.py +0 -0
  54. {discord → scurrypy}/models/integration.py +0 -0
  55. {discord → scurrypy}/models/member.py +0 -0
  56. {discord → scurrypy}/models/role.py +0 -0
  57. {discord → scurrypy}/models/user.py +0 -0
  58. {discord → scurrypy}/parts/__init__.py +0 -0
  59. {discord → scurrypy}/parts/component_types.py +0 -0
  60. {discord → scurrypy}/resources/__init__.py +0 -0
  61. {discord → scurrypy}/resources/application.py +0 -0
  62. {discord → scurrypy}/resources/bot_emojis.py +0 -0
  63. {discord → scurrypy}/resources/user.py +0 -0
  64. {scurrypy-0.4.2.dist-info → scurrypy-0.5.3.dist-info}/WHEEL +0 -0
  65. {scurrypy-0.4.2.dist-info → scurrypy-0.5.3.dist-info}/licenses/LICENSE +0 -0
discord/parts/message.py DELETED
@@ -1,194 +0,0 @@
1
- from dataclasses import dataclass, field
2
- from typing import Optional, TypedDict, Unpack, Literal
3
- from discord.model import DataModel
4
- from .embed import EmbedBuilder
5
- from .action_row import ActionRow
6
- from .components_v2 import Container
7
-
8
- class MessageFlags:
9
- """Flags that can be applied to a message."""
10
- CROSSPOSTED = 1 << 0
11
- """Message has been published."""
12
-
13
- IS_CROSSPOST = 1 << 1
14
- """Message originated from another channel."""
15
-
16
- SUPPRESS_EMBEDS = 1 << 2
17
- """Hide embeds (if any)."""
18
-
19
- EPHEMERAL = 1 << 6
20
- """Only visible to the invoking user."""
21
-
22
- LOADING = 1 << 7
23
- """Thinking response."""
24
-
25
- IS_COMPONENTS_V2 = 1 << 15
26
- """This message includes Discord's V2 Components."""
27
-
28
- class MessageFlagParams(TypedDict, total=False):
29
- """Parameters for setting message flags."""
30
- crossposted: bool
31
- is_crosspost: bool
32
- suppress_embeds: bool
33
- ephemeral: bool
34
- loading: bool
35
- is_components_v2: bool
36
-
37
- @dataclass
38
- class _MessageReference(DataModel):
39
- message_id: int
40
- channel_id: int
41
- type: int = 0
42
-
43
- @dataclass
44
- class _Attachment(DataModel):
45
- """Represents an attachment."""
46
- id: int
47
- path: str
48
- filename: str
49
- description: str
50
-
51
- def _to_dict(self):
52
- return {
53
- 'id': self.id,
54
- 'filename': self.filename,
55
- 'description': self.description
56
- }
57
-
58
- @dataclass
59
- class MessageBuilder(DataModel):
60
- """Describes expected params when editing/creating a message."""
61
-
62
- content: Optional[str] = None
63
- """Message text content."""
64
-
65
- flags: Optional[int] = 0
66
- """Message flags. See [`MessageFlags`][discord.parts.message.MessageFlags] for details."""
67
-
68
- components: Optional[list[ActionRow | Container]] = field(default_factory=list)
69
- """Components to be attached to this message."""
70
-
71
- attachments: Optional[list[_Attachment]] = field(default_factory=list)
72
- """Attachments to be attached to this message."""
73
-
74
- embeds: Optional[list[EmbedBuilder]] = field(default_factory=list)
75
- """Embeds to be attached to this message."""
76
-
77
- message_reference: Optional[_MessageReference] = None
78
- """Message reference if reply."""
79
-
80
- def add_row(self, row: ActionRow):
81
- """Add an action row to this message.
82
-
83
- Args:
84
- row (ActionRow): the ActionRow object
85
-
86
- Returns:
87
- (MessageBuilder): self
88
- """
89
- self.components.append(row)
90
- return self
91
-
92
- def add_container(self, container: Container, *, has_container_boarder: bool = False):
93
- """Add a container to this message.
94
-
95
- Args:
96
- container (Container): the Container object.
97
- has_container_boarder (bool, optional): If message should be contained in an Embed-like container. Defaults to False.
98
-
99
- Returns:
100
- (MessageBuilder): self
101
- """
102
- if has_container_boarder:
103
- self.components.append(container)
104
- else:
105
- self.components.extend(container.components)
106
- return self
107
-
108
- def add_embed(self, embed: EmbedBuilder):
109
- """Add an embed to this message.
110
-
111
- Args:
112
- embed (EmbedBuilder): The EmbedBuilder object.
113
-
114
- Returns:
115
- (MessageBuilder): self
116
- """
117
- self.embeds.append(embed)
118
- return self
119
-
120
- def add_attachment(self, file_path: str, description: str = None):
121
- """Add an attachment to this message
122
-
123
- Args:
124
- file_path (str): full qualifying path to file
125
- description (str, optional): file descriptor. Defaults to None.
126
-
127
- Returns:
128
- (MessageBuilder): self
129
- """
130
- import os
131
-
132
- self.attachments.append(
133
- _Attachment(
134
- id=len(self.attachments),
135
- filename=os.path.basename(file_path),
136
- path=file_path,
137
- description=description
138
- )
139
- )
140
- return self
141
-
142
- def set_flags(self, **flags: Unpack[MessageFlagParams]):
143
- """Set this message's flags using MessageFlagParams.
144
-
145
- Args:
146
- flags (Unpack[MessageFlagParams]): message flags to set. (set respective flag to True to toggle.)
147
-
148
- Raises:
149
- (ValueError): invalid flag
150
-
151
- Returns:
152
- (MessageBuilder): self
153
- """
154
- _flag_map = {
155
- 'crossposted': MessageFlags.CROSSPOSTED,
156
- 'is_crosspost': MessageFlags.IS_CROSSPOST,
157
- 'suppress_embeds': MessageFlags.SUPPRESS_EMBEDS,
158
- 'ephemeral': MessageFlags.EPHEMERAL,
159
- 'loading': MessageFlags.LOADING,
160
- 'is_components_v2': MessageFlags.IS_COMPONENTS_V2,
161
- }
162
-
163
- # each flag maps to a specific combined bit!
164
- for name, value in flags.items():
165
- if name not in _flag_map:
166
- raise ValueError(f"Invalid flag: {name}")
167
- if value:
168
- self.flags |= _flag_map[name]
169
-
170
- return self
171
-
172
- def _set_reference(self,
173
- message_id: int,
174
- channel_id: int,
175
- ref_type: Literal['Default', 'Forward'] = 'Default'
176
- ):
177
- """Internal helper for setting this message's reference message. Used in replies.
178
-
179
- Args:
180
- message_id (int): message to reference
181
-
182
- Returns:
183
- (MessageBuilder): self
184
- """
185
- _ref_types = {
186
- 'DEFAULT': 0,
187
- 'FORWARD': 1
188
- }
189
- self.message_reference = _MessageReference(
190
- type=_ref_types.get(ref_type.upper()),
191
- channel_id=channel_id,
192
- message_id=message_id
193
- )
194
- return self
discord/parts/modal.py DELETED
@@ -1,21 +0,0 @@
1
- from dataclasses import dataclass, field
2
- from discord.model import DataModel
3
- from .components_v2 import Label
4
-
5
- @dataclass
6
- class ModalBuilder(DataModel):
7
- title: str
8
- custom_id: str = None
9
- components: list[Label] = field(default_factory=list)
10
-
11
- def add_label(self, component: Label):
12
- """Add a label component to this modal.
13
-
14
- Args:
15
- component (Label): the label component
16
-
17
- Returns:
18
- ModalBuilder: self
19
- """
20
- self.components.append(component)
21
- return self
@@ -1,54 +0,0 @@
1
- discord/__init__.py,sha256=cETkxHmm0s9YkSJgn-1daQhnbL96fuD7L9SIg2t5vBg,6823
2
- discord/client.py,sha256=feTk5CXgYEMeV9bd3ahz2TcrjqtjRElVRBGU6wwzaoY,14225
3
- discord/client_like.py,sha256=JyJq0XBq0vKuPBJ_ZnYf5yAAuX1zz_2B1TZBQE-BYbQ,473
4
- discord/config.py,sha256=OH1A2mNKhDlGvQYASEsVUx2pNxP1YQ2a7a7z-IM5xFg,200
5
- discord/error.py,sha256=AlislRTna554cM6KC0KrwKugzYDYtx_9C8_3QFe4XDc,2070
6
- discord/gateway.py,sha256=L0SE7N29rg02JtNv670JMbw8LMLvtEsLF4LPM33OlHM,5110
7
- discord/http.py,sha256=baazuV0EepetcCvbt-ldse27FgS33eAWbre9i0rBzZ4,7930
8
- discord/intents.py,sha256=Lf2fogFFDqilZeKJv7tcUgKmMW3D7ykK4bBNi-zDzYA,2866
9
- discord/logger.py,sha256=7lks8VyU538nUr_OfiUXRFOtXlpOLZSLvLoDRxJ8loY,4929
10
- discord/model.py,sha256=CmuxyoWLWokE_UvCQ9M7U9Cr7JH9R7ULMv9KMwzXjDQ,3105
11
- discord/dispatch/__init__.py,sha256=m7ixrbNhOV9QRORXPw6LSwxofQMAvLmPFBweBZu9ACc,20
12
- discord/dispatch/command_dispatcher.py,sha256=4yyw-PspQrKWG40oSWOSz_SmmqG2D2HTpRmaVi19H2Q,5954
13
- discord/dispatch/event_dispatcher.py,sha256=0hX4oSQloxColXNxPT2iWnqi4S9VKTxyD9_MSPsVYUM,3769
14
- discord/dispatch/prefix_dispatcher.py,sha256=HXgL5XqrQK08iJ4G_SgsLuC-s0YoH3FlqPY_bR6JLlQ,2115
15
- discord/events/__init__.py,sha256=xE8YtJ7NKZkm7MLnohDQIbezh3ColmLR-3BMiZabt3k,18
16
- discord/events/channel_events.py,sha256=t9UL4JjDqulAP_XepQ8MRMW54pNRqCbIK3M8tauzf9I,1556
17
- discord/events/guild_events.py,sha256=Ok9tW3tjcwtbiqJgbe-42d9-R3-2RzqmIgBHEP-2Pcc,896
18
- discord/events/hello_event.py,sha256=O8Ketu_N943cnGaFkGsAHfWhgKXFQCYCqSD3EqdsXjA,225
19
- discord/events/interaction_events.py,sha256=p5jb_KXrbE84773flwvbbS6yeh4f1w5Z-y93nQZJbEk,4374
20
- discord/events/message_events.py,sha256=M5xdaJH1zRzdZk0oN0Jykaeu9k09EjgZjeiIT_EkL1A,1475
21
- discord/events/reaction_events.py,sha256=xx7GD-fqakhJmS-X-HbuAUg9pg6Gqo_KRtLTdPJu7UE,2643
22
- discord/events/ready_event.py,sha256=c3Pf4ndNYV2byuliADi8pUxpuvKXa9FLKNz_uzIWGso,794
23
- discord/models/__init__.py,sha256=ZKhFO5eX4GbTRdvi4CU4z2hO-HQU29WZw2x4DujvARY,18
24
- discord/models/application.py,sha256=2sXtRysUc2TJ40FjdcrWgosmwMrp_h3ybddubQMixKM,924
25
- discord/models/emoji.py,sha256=6iz1DhWj_eTUj2KHmwMewjB3AdEBm68EmIZp2WFFCQg,932
26
- discord/models/guild.py,sha256=aXUByOUUIGt9d2qIGC6_X_vh0Nyib8Iqj5ZElBeNV_I,819
27
- discord/models/integration.py,sha256=V29RO2925mQbVXPAMt665cML3m8mJACYmdJLWwbbUyE,612
28
- discord/models/interaction.py,sha256=VPbf49C1RmQpDSODk3e1voW8EnbVsH_w1qpmiq4hVRM,700
29
- discord/models/member.py,sha256=pkI-NVRMb3hUBkxI26FSYZxzx2mRNGXOeWWCw3BGGsY,705
30
- discord/models/role.py,sha256=erlERmK-IZz4YzSNY-XLNvCc-Z5PoVlClxPOX67dQJg,1169
31
- discord/models/user.py,sha256=lgG6GoU_7L68oHt6PGTzTkU1vrbsclRQzGjKzsLBeKA,298
32
- discord/parts/__init__.py,sha256=yROb-BqEw-FKXqq_-0WbP33U-Arm_9NpJuEamXpvjeA,19
33
- discord/parts/action_row.py,sha256=QVi5-ZtVRBKbG0n0L53cj4bu2ZEMUnJ9y3TlqFxaHlg,7105
34
- discord/parts/channel.py,sha256=2wmEjmRqUpORzL3CFp2rugMxrpSm_LxxvlcrmWIH4r4,584
35
- discord/parts/command.py,sha256=CPyPO_T5ULp7j7syF9z2LztP3SF6KyX89sodz2c40Aw,2924
36
- discord/parts/component_types.py,sha256=qr1R0jzXpE_h9Xv4P5DyYRSuhxS0Qnm9aag-JKrJvBA,131
37
- discord/parts/components_v2.py,sha256=R2ihx8st12oHUFxJ-H_-qPR-4aSlSPslNfKOCBNiwTw,11403
38
- discord/parts/embed.py,sha256=_PV-lEAKn-MiXyyLa2s8JKHEplA8J9dDO80NPdZtmLk,3986
39
- discord/parts/message.py,sha256=xfzVuDafx9kXsY4Mfk3urMj1HbJXTEVdHvyTZKRwCt0,5800
40
- discord/parts/modal.py,sha256=EX6J9Mh5dAQBOZqYKzSE7SFsKLfM_B1BhcJamjBNkZw,554
41
- discord/parts/role.py,sha256=cK96UdgT-kU0gY5C_1LZXPrYg144x2RDmGjT28so57A,920
42
- discord/resources/__init__.py,sha256=EdzYKftSLqqr3Bpzc0_90kfozJXOtp9jNTIHhCTt_-0,21
43
- discord/resources/application.py,sha256=vYMTli_FSbC7venMepsJ9bkzdEQVkKYpnxCJ9K2XDho,2765
44
- discord/resources/bot_emojis.py,sha256=RvGCSOBkjS39P2aab0FzYUOTzBOiHX99RLrJZzAYNiU,1701
45
- discord/resources/channel.py,sha256=HC7PCtjP8mjyEZSOhYqoiqJaGbawZA4XOL3GkTlWScA,6920
46
- discord/resources/guild.py,sha256=jVlkdeMfB97q9qbgOn1g3Wtt0BcL9Ktj4hbbATnnbus,8234
47
- discord/resources/interaction.py,sha256=sUg5HOZLZvb_LWwHwyfPlcgMMuIXrNpvjVwR2efwVDk,5937
48
- discord/resources/message.py,sha256=Oo3-EbJMt0UHK77x3CndjYwRrWbp5Vf5UHSIJqXzNHE,7542
49
- discord/resources/user.py,sha256=vk89TnCVi-6ZgbDs_TZTCXrx_NfFS5Q9Wi_itYoaoyg,3085
50
- scurrypy-0.4.2.dist-info/licenses/LICENSE,sha256=qIlBETYpSEU8glbiwiJbuDxVl-2WIuf1PDqJemMjKkc,792
51
- scurrypy-0.4.2.dist-info/METADATA,sha256=pRS8E9-8LJqorJuro5-RGnpeamSORAVjL6q45BfwTfI,4797
52
- scurrypy-0.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
- scurrypy-0.4.2.dist-info/top_level.txt,sha256=fJkrNbR-_8ubMBUcDEJBcfkpECrvSEmMrNKgvLlQFoM,8
54
- scurrypy-0.4.2.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- discord
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes