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
discord/parts/embed.py
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from typing import Optional
|
|
3
|
-
from discord.model import DataModel
|
|
4
|
-
from datetime import datetime, timezone
|
|
5
|
-
from ..models.user import UserModel
|
|
6
|
-
|
|
7
|
-
@dataclass
|
|
8
|
-
class _EmbedAuthor(DataModel):
|
|
9
|
-
"""Embed author parameters."""
|
|
10
|
-
name: str
|
|
11
|
-
url: Optional[str] = None
|
|
12
|
-
icon_url: Optional[str] = None
|
|
13
|
-
|
|
14
|
-
@dataclass
|
|
15
|
-
class _EmbedThumbnail(DataModel):
|
|
16
|
-
"""Embed thumbnail."""
|
|
17
|
-
url: str
|
|
18
|
-
|
|
19
|
-
@dataclass
|
|
20
|
-
class _EmbedImage(DataModel):
|
|
21
|
-
"""Embed image."""
|
|
22
|
-
url: str
|
|
23
|
-
|
|
24
|
-
@dataclass
|
|
25
|
-
class _EmbedFooter(DataModel):
|
|
26
|
-
"""Embed footer."""
|
|
27
|
-
text: str
|
|
28
|
-
url: Optional[str] = None
|
|
29
|
-
icon_url: Optional[str] = None
|
|
30
|
-
|
|
31
|
-
@dataclass
|
|
32
|
-
class _EmbedField(DataModel):
|
|
33
|
-
"""Embed field."""
|
|
34
|
-
name: str
|
|
35
|
-
value: str
|
|
36
|
-
inline: Optional[bool] = None
|
|
37
|
-
|
|
38
|
-
@dataclass
|
|
39
|
-
class EmbedBuilder(DataModel):
|
|
40
|
-
"""Represents the Embed portion of a message."""
|
|
41
|
-
|
|
42
|
-
title: Optional[str] = None
|
|
43
|
-
"""This embed's title."""
|
|
44
|
-
|
|
45
|
-
description: Optional[str] = None
|
|
46
|
-
"""This embed's description."""
|
|
47
|
-
|
|
48
|
-
timestamp: Optional[str] = None
|
|
49
|
-
"""Timestamp of when the embed was sent."""
|
|
50
|
-
|
|
51
|
-
color: Optional[int] = None
|
|
52
|
-
"""Embed's accent color."""
|
|
53
|
-
|
|
54
|
-
author: Optional[_EmbedAuthor] = None
|
|
55
|
-
"""Embed's author."""
|
|
56
|
-
|
|
57
|
-
thumbnail: Optional[_EmbedThumbnail] = None
|
|
58
|
-
"""Embed's thumbnail attachment."""
|
|
59
|
-
|
|
60
|
-
image: Optional[_EmbedImage] = None
|
|
61
|
-
"""Embed's image attachment."""
|
|
62
|
-
|
|
63
|
-
fields: Optional[list[_EmbedField]] = None
|
|
64
|
-
"""List of embed's fields."""
|
|
65
|
-
|
|
66
|
-
footer: Optional[_EmbedFooter] = None
|
|
67
|
-
"""Embed's footer."""
|
|
68
|
-
|
|
69
|
-
def set_color(self, hex: str):
|
|
70
|
-
"""Set this embed's color with a hex.
|
|
71
|
-
|
|
72
|
-
Args:
|
|
73
|
-
hex (str): color as a hex code (format: #FFFFFF)
|
|
74
|
-
|
|
75
|
-
Returns:
|
|
76
|
-
(EmbedBuilder): self
|
|
77
|
-
"""
|
|
78
|
-
self.color=int(hex.strip('#'), 16)
|
|
79
|
-
return self
|
|
80
|
-
|
|
81
|
-
def set_user_author(self, user: UserModel):
|
|
82
|
-
"""Set this embed's author.
|
|
83
|
-
|
|
84
|
-
Args:
|
|
85
|
-
user (UserModel): the user model
|
|
86
|
-
|
|
87
|
-
Returns:
|
|
88
|
-
(EmbedBuilder): self
|
|
89
|
-
"""
|
|
90
|
-
self.author = _EmbedAuthor(
|
|
91
|
-
name=user.username,
|
|
92
|
-
icon_url=f"https://cdn.discordapp.com/avatars/{user.id}/{user.avatar}.png"
|
|
93
|
-
)
|
|
94
|
-
return self
|
|
95
|
-
|
|
96
|
-
def set_image(self, url: str):
|
|
97
|
-
"""Set this embed's image.
|
|
98
|
-
|
|
99
|
-
Args:
|
|
100
|
-
url (str): attachment://<file> scheme or http(s) URL
|
|
101
|
-
|
|
102
|
-
Returns:
|
|
103
|
-
(EmbedBuilder): self
|
|
104
|
-
"""
|
|
105
|
-
self.image = _EmbedImage(url=url)
|
|
106
|
-
return self
|
|
107
|
-
|
|
108
|
-
def set_thumbnail(self, url: str):
|
|
109
|
-
"""Set this embed's thumbnail.
|
|
110
|
-
|
|
111
|
-
Args:
|
|
112
|
-
url (str): attachment://<file> scheme or http(s) URL
|
|
113
|
-
|
|
114
|
-
Returns:
|
|
115
|
-
(EmbedBuilder): self
|
|
116
|
-
"""
|
|
117
|
-
self.thumbnail = _EmbedThumbnail(url=url)
|
|
118
|
-
return self
|
|
119
|
-
|
|
120
|
-
def set_footer(self, text: str, icon_url: str = None):
|
|
121
|
-
"""Set this embed's footer.
|
|
122
|
-
|
|
123
|
-
Args:
|
|
124
|
-
text (str): footer's text
|
|
125
|
-
icon_url (str, optional): attachment://<file> scheme or http(s) URL.
|
|
126
|
-
|
|
127
|
-
Returns:
|
|
128
|
-
(EmbedBuilder): self
|
|
129
|
-
"""
|
|
130
|
-
self.footer = _EmbedFooter(text=text, icon_url=icon_url)
|
|
131
|
-
return self
|
|
132
|
-
|
|
133
|
-
def add_field(self, name: str, value: str, is_inline: bool = False):
|
|
134
|
-
"""Add a field to this embed.
|
|
135
|
-
|
|
136
|
-
Args:
|
|
137
|
-
name (str): field's title
|
|
138
|
-
value (str): field's text
|
|
139
|
-
is_inline (bool): if this field should be inlined
|
|
140
|
-
|
|
141
|
-
Returns:
|
|
142
|
-
(EmbedBuilder): self
|
|
143
|
-
"""
|
|
144
|
-
self.fields.append(_EmbedField(name=name, value=value, inline=is_inline))
|
|
145
|
-
return self
|
|
146
|
-
|
|
147
|
-
def set_timestamp(self):
|
|
148
|
-
"""Set this embed's timestamp.
|
|
149
|
-
|
|
150
|
-
Returns:
|
|
151
|
-
(EmbedBuilder): self
|
|
152
|
-
"""
|
|
153
|
-
self.timestamp = datetime.now(timezone.utc).isoformat()
|
|
154
|
-
return self
|
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
|
scurrypy-0.4.dist-info/METADATA
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: scurrypy
|
|
3
|
-
Version: 0.4
|
|
4
|
-
Summary: Dataclass-driven Discord API Wrapper in Python
|
|
5
|
-
Author: Furmissile
|
|
6
|
-
Requires-Python: >=3.10
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Dynamic: license-file
|
|
10
|
-
|
|
11
|
-
# __Welcome to ScurryPy__
|
|
12
|
-
|
|
13
|
-
[](https://badge.fury.io/py/scurrypy)
|
|
14
|
-
|
|
15
|
-
> **Official Repository**
|
|
16
|
-
> This is the original and official repository of **ScurryPy**, maintained by [Furmissile](https://github.com/Furmissile).
|
|
17
|
-
> Forks and community extensions are welcome under the project’s license and attribution guidelines.
|
|
18
|
-
|
|
19
|
-
A dataclass-driven Discord API wrapper in Python!
|
|
20
|
-
|
|
21
|
-
While this wrapper is mainly used for various squirrel-related shenanigans, it can also be used for more generic bot purposes.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Features
|
|
26
|
-
* Command and event handling
|
|
27
|
-
* Declarative style using decorators
|
|
28
|
-
* Supports both legacy and new features
|
|
29
|
-
* Respects Discord’s rate limits
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Some Things to Consider...
|
|
34
|
-
* This is an early version — feedback, ideas, and contributions are very welcome! That said, there may be bumps along the way, so expect occasional bugs and quirks.
|
|
35
|
-
* Certain features are not yet supported, while others are intentionally omitted. See the [docs](https://furmissile.github.io/scurrypy) for full details.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Getting Started
|
|
40
|
-
*Note: This section also appears in the documentation, but here are complete examples ready to use with your bot credentials.*
|
|
41
|
-
|
|
42
|
-
### Installation
|
|
43
|
-
To install the ScurryPy package, run:
|
|
44
|
-
```bash
|
|
45
|
-
pip install scurrypy
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Minimal Slash Command
|
|
49
|
-
The following demonstrates building and responding to a slash command.
|
|
50
|
-
|
|
51
|
-
*Note: Adjust `dotenv_path` if your `.env` file is not in the same directory as this script.*
|
|
52
|
-
|
|
53
|
-
```py
|
|
54
|
-
import discord, os
|
|
55
|
-
from dotenv import load_dotenv
|
|
56
|
-
|
|
57
|
-
load_dotenv(dotenv_path='./path/to/env')
|
|
58
|
-
|
|
59
|
-
client = discord.Client(
|
|
60
|
-
token=os.getenv("DISCORD_TOKEN"),
|
|
61
|
-
application_id=APPLICATION_ID # replace with your bot's user ID
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
@client.command(
|
|
65
|
-
command=discord.SlashCommand(
|
|
66
|
-
name='example',
|
|
67
|
-
description='Demonstrate the minimal slash command!'
|
|
68
|
-
),
|
|
69
|
-
guild_ids=GUILD_ID # must be a guild ID your bot is in
|
|
70
|
-
)
|
|
71
|
-
async def example(bot: discord.Client, event: discord.InteractionEvent):
|
|
72
|
-
await event.interaction.respond(f'Hello, {event.interaction.member.user.username}!')
|
|
73
|
-
|
|
74
|
-
client.run()
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Minimal Prefix Command (Legacy)
|
|
78
|
-
The following demonstrates building and responding to a message prefix command.
|
|
79
|
-
```py
|
|
80
|
-
import discord, os
|
|
81
|
-
from dotenv import load_dotenv
|
|
82
|
-
|
|
83
|
-
load_dotenv(dotenv_path='./path/to/env')
|
|
84
|
-
|
|
85
|
-
client = discord.Client(
|
|
86
|
-
token=os.getenv("DISCORD_TOKEN"),
|
|
87
|
-
application_id=APPLICATION_ID, # replace with your bot's user ID
|
|
88
|
-
intents=discord.set_intents(message_content=True),
|
|
89
|
-
prefix='!' # your custom prefix
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
@client.prefix_command
|
|
93
|
-
async def ping(bot: discord.Client, event: discord.MessageCreateEvent):
|
|
94
|
-
# The function name is the name of the command
|
|
95
|
-
await event.message.send("Pong!")
|
|
96
|
-
|
|
97
|
-
client.run()
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Contribution and Fork Policy
|
|
101
|
-
ScurryPy follows a simple philosophy: **clarity, simplicity, and direct interaction with the Discord API**.
|
|
102
|
-
It favors explicit, dataclass-driven design over heavy abstraction — and contributions should stay true to that style.
|
|
103
|
-
|
|
104
|
-
This is a community-supported project guided by the design and principles of **Furmissile**.
|
|
105
|
-
You are welcome to explore, modify, and extend the codebase under the terms of its license — but please follow these guidelines to ensure proper attribution and clarity.
|
|
106
|
-
|
|
107
|
-
### You May
|
|
108
|
-
* Fork this repository for personal or collaborative development.
|
|
109
|
-
* Submit pull requests for bug fixes or new features that align with ScurryPy’s goals.
|
|
110
|
-
* Reuse parts of the code in your own projects, provided attribution is preserved.
|
|
111
|
-
|
|
112
|
-
### You May NOT
|
|
113
|
-
* Remove or alter existing copyright notices or attributions.
|
|
114
|
-
* Present a fork as the official ScurryPy project.
|
|
115
|
-
* Use the name “ScurryPy” or its documentation to promote a fork without permission.
|
|
116
|
-
|
|
117
|
-
If you plan to make substantial changes or release your own variant:
|
|
118
|
-
* Rename the fork to avoid confusion (e.g., `scurrypy-plus` or `scurrypy-extended`).
|
|
119
|
-
* Add a note in your README acknowledging the original project:
|
|
120
|
-
> "This project is a fork of [ScurryPy](https://github.com/Furmissile/scurrypy)
|
|
121
|
-
by Furmissile."
|
|
122
|
-
|
|
123
|
-
## License
|
|
124
|
-
This project is licensed under the Furmissile License, which allows viewing, modification, and redistribution with proper attribution.
|
|
125
|
-
|
|
126
|
-
See the [License](./LICENSE) for details.
|
|
127
|
-
|
|
128
|
-
## Like What You See?
|
|
129
|
-
Check out the full [documentation](https://furmissile.github.io/scurrypy)
|
|
130
|
-
for more examples, guides, and API reference!
|
scurrypy-0.4.dist-info/RECORD
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
discord/__init__.py,sha256=cETkxHmm0s9YkSJgn-1daQhnbL96fuD7L9SIg2t5vBg,6823
|
|
2
|
-
discord/client.py,sha256=9DcgF8Tb-K7t781GILBIh4LcU_Q1aYrNW_mHU-TA0bw,14144
|
|
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=1TVUKrd3JovoM4df5-GlMZ0kz15Xls5V48ShXDSlK3Q,5334
|
|
7
|
-
discord/http.py,sha256=BI7bCjedh8zuu5pdOLhI-XwMZfdVj5qP9ZZY6WJqtgo,10511
|
|
8
|
-
discord/intents.py,sha256=Lf2fogFFDqilZeKJv7tcUgKmMW3D7ykK4bBNi-zDzYA,2866
|
|
9
|
-
discord/logger.py,sha256=qAmOc3geCcCCqPhdi61SVWzMDewmM8Q_KWhTcjO46j8,4726
|
|
10
|
-
discord/model.py,sha256=CmuxyoWLWokE_UvCQ9M7U9Cr7JH9R7ULMv9KMwzXjDQ,3105
|
|
11
|
-
discord/dispatch/__init__.py,sha256=m7ixrbNhOV9QRORXPw6LSwxofQMAvLmPFBweBZu9ACc,20
|
|
12
|
-
discord/dispatch/command_dispatcher.py,sha256=pyJOQaZLZYrHUEs6HEWp8XMKTMZX4SBrwTizGKIeUG8,5904
|
|
13
|
-
discord/dispatch/event_dispatcher.py,sha256=1A7Qof_IzTi5_14IMPxIQDpvo3-Sj-X0KZWOuVGH53k,3764
|
|
14
|
-
discord/dispatch/prefix_dispatcher.py,sha256=4mkn3cuXTjdEChbewkbZQqd_sMKm4jePSFKKOPbt12g,2065
|
|
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=fe2JUp943VnXa-BKyRMtNP-JyNd_Mp516sWBKHKn_GI,6915
|
|
46
|
-
discord/resources/guild.py,sha256=Unld1lWY3XynmRHU2FCi3-LA9VNp2thMI2BlILUTTxk,8183
|
|
47
|
-
discord/resources/interaction.py,sha256=esbkN8r7c1GhAvRqldrua_a6PSuIVPJLw3OQAZ0zy1c,5922
|
|
48
|
-
discord/resources/message.py,sha256=RtvcCRx0lwW-mHPl3aNYoEvGffrvtpLsQ2fVWckywVI,7527
|
|
49
|
-
discord/resources/user.py,sha256=vk89TnCVi-6ZgbDs_TZTCXrx_NfFS5Q9Wi_itYoaoyg,3085
|
|
50
|
-
scurrypy-0.4.dist-info/licenses/LICENSE,sha256=qIlBETYpSEU8glbiwiJbuDxVl-2WIuf1PDqJemMjKkc,792
|
|
51
|
-
scurrypy-0.4.dist-info/METADATA,sha256=J9enmBVZsPDNbClN0t9p5_SAksFXso23AIjtgBREbNE,4795
|
|
52
|
-
scurrypy-0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
53
|
-
scurrypy-0.4.dist-info/top_level.txt,sha256=fJkrNbR-_8ubMBUcDEJBcfkpECrvSEmMrNKgvLlQFoM,8
|
|
54
|
-
scurrypy-0.4.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
discord
|
{discord → scurrypy}/config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|