scurrypy 0.3.2__tar.gz → 0.3.4.1__tar.gz

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 (67) hide show
  1. scurrypy-0.3.4.1/PKG-INFO +92 -0
  2. scurrypy-0.3.4.1/README.md +82 -0
  3. scurrypy-0.3.4.1/discord/__init__.py +223 -0
  4. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/client.py +129 -115
  5. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/dispatch/event_dispatcher.py +32 -27
  6. scurrypy-0.3.4.1/discord/events/__init__.py +1 -0
  7. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/events/channel_events.py +7 -1
  8. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/events/guild_events.py +4 -2
  9. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/events/message_events.py +4 -3
  10. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/events/reaction_events.py +5 -4
  11. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/gateway.py +37 -57
  12. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/http.py +4 -16
  13. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/logger.py +4 -3
  14. scurrypy-0.3.4.1/discord/models/__init__.py +1 -0
  15. scurrypy-0.3.4.1/discord/parts/__init__.py +2 -0
  16. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/message.py +2 -1
  17. scurrypy-0.3.4.1/discord/resources/__init__.py +1 -0
  18. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/resources/interaction.py +0 -2
  19. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/pyproject.toml +1 -1
  20. scurrypy-0.3.4.1/scurrypy.egg-info/PKG-INFO +92 -0
  21. scurrypy-0.3.2/PKG-INFO +0 -85
  22. scurrypy-0.3.2/README.md +0 -75
  23. scurrypy-0.3.2/discord/__init__.py +0 -10
  24. scurrypy-0.3.2/discord/events/__init__.py +0 -33
  25. scurrypy-0.3.2/discord/models/__init__.py +0 -8
  26. scurrypy-0.3.2/discord/parts/__init__.py +0 -28
  27. scurrypy-0.3.2/discord/resources/__init__.py +0 -10
  28. scurrypy-0.3.2/scurrypy.egg-info/PKG-INFO +0 -85
  29. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/LICENSE +0 -0
  30. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/client_like.py +0 -0
  31. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/config.py +0 -0
  32. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/dispatch/__init__.py +0 -0
  33. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/dispatch/command_dispatcher.py +0 -0
  34. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/dispatch/prefix_dispatcher.py +0 -0
  35. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/error.py +0 -0
  36. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/events/hello_event.py +0 -0
  37. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/events/interaction_events.py +0 -0
  38. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/events/ready_event.py +0 -0
  39. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/intents.py +0 -0
  40. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/model.py +0 -0
  41. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/models/application.py +0 -0
  42. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/models/emoji.py +0 -0
  43. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/models/guild.py +0 -0
  44. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/models/integration.py +0 -0
  45. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/models/interaction.py +0 -0
  46. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/models/member.py +0 -0
  47. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/models/role.py +0 -0
  48. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/models/user.py +0 -0
  49. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/action_row.py +0 -0
  50. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/attachment.py +0 -0
  51. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/channel.py +0 -0
  52. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/command.py +0 -0
  53. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/component_types.py +0 -0
  54. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/components_v2.py +0 -0
  55. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/embed.py +0 -0
  56. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/modal.py +0 -0
  57. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/parts/role.py +0 -0
  58. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/resources/application.py +0 -0
  59. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/resources/bot_emojis.py +0 -0
  60. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/resources/channel.py +0 -0
  61. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/resources/guild.py +0 -0
  62. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/resources/message.py +0 -0
  63. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/discord/resources/user.py +0 -0
  64. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/scurrypy.egg-info/SOURCES.txt +0 -0
  65. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/scurrypy.egg-info/dependency_links.txt +0 -0
  66. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/scurrypy.egg-info/top_level.txt +0 -0
  67. {scurrypy-0.3.2 → scurrypy-0.3.4.1}/setup.cfg +0 -0
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: scurrypy
3
+ Version: 0.3.4.1
4
+ Summary: 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
+ [![PyPI version](https://badge.fury.io/py/scurrypy.svg)](https://badge.fury.io/py/scurrypy)
14
+
15
+ Yet another Discord API wrapper in Python!
16
+
17
+ While this wrapper is mainly used for various squirrel-related shenanigans, it can also be used for more generic bot purposes.
18
+
19
+ ## Features
20
+ * Command and event handling
21
+ * Declarative style using decorators
22
+ * Supports both legacy and new features
23
+ * Respects Discord's rate limits
24
+
25
+ ## Some things to consider...
26
+ * 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.
27
+ * Certain features are not yet supported, while others are intentionally omitted. See the [docs](https://furmissile.github.io/scurrypy) for full details.
28
+
29
+ ## Getting Started
30
+ *Note: This section also appears in the documentation, but here are complete examples ready to use with your bot credentials.*
31
+
32
+ ### Installation
33
+ To install the ScurryPy package, run:
34
+ ```bash
35
+ pip install scurrypy
36
+ ```
37
+
38
+ ### Minimal Slash Command
39
+ The following demonstrates building and responding to a slash command.
40
+
41
+ *Note: Adjust `dotenv_path` if your `.env` file is not in the same directory as this script.*
42
+
43
+ ```python
44
+ import discord, os
45
+ from dotenv import load_dotenv
46
+
47
+ load_dotenv(dotenv_path='./path/to/env')
48
+
49
+ client = discord.Client(
50
+ token=os.getenv("DISCORD_TOKEN"),
51
+ application_id=APPLICATION_ID # replace with your bot's user ID
52
+ )
53
+
54
+ @client.command(
55
+ command=discord.SlashCommand(
56
+ name='example',
57
+ description='Demonstrate the minimal slash command!'
58
+ ),
59
+ guild_id=GUILD_ID # must be a guild ID your bot is in
60
+ )
61
+ async def example(bot: discord.Client, event: discord.InteractionEvent):
62
+ await event.interaction.respond(f'Hello, {event.interaction.member.user.username}!')
63
+
64
+ client.run()
65
+ ```
66
+
67
+ ### Minimal Prefix Command (Legacy)
68
+ The following demonstrates building and responding to a message prefix command.
69
+
70
+ ```python
71
+ import discord, os
72
+ from dotenv import load_dotenv
73
+
74
+ load_dotenv(dotenv_path='./path/to/env')
75
+
76
+ client = discord.Client(
77
+ token=os.getenv("DISCORD_TOKEN"),
78
+ application_id=APPLICATION_ID, # replace with your bot's user ID
79
+ intents=discord.set_intents(message_content=True),
80
+ prefix='!' # your custom prefix
81
+ )
82
+
83
+ @client.prefix_command
84
+ async def ping(bot: discord.Client, event: discord.MessageCreateEvent):
85
+ # The function name is the name of the command
86
+ await event.message.send("Pong!")
87
+
88
+ client.run()
89
+ ```
90
+
91
+ ## Like what you see?
92
+ Check out the full [documentation](https://furmissile.github.io/scurrypy) for more examples, guides, and API reference!
@@ -0,0 +1,82 @@
1
+ # __Welcome to ScurryPy__
2
+
3
+ [![PyPI version](https://badge.fury.io/py/scurrypy.svg)](https://badge.fury.io/py/scurrypy)
4
+
5
+ Yet another Discord API wrapper in Python!
6
+
7
+ While this wrapper is mainly used for various squirrel-related shenanigans, it can also be used for more generic bot purposes.
8
+
9
+ ## Features
10
+ * Command and event handling
11
+ * Declarative style using decorators
12
+ * Supports both legacy and new features
13
+ * Respects Discord's rate limits
14
+
15
+ ## Some things to consider...
16
+ * 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.
17
+ * Certain features are not yet supported, while others are intentionally omitted. See the [docs](https://furmissile.github.io/scurrypy) for full details.
18
+
19
+ ## Getting Started
20
+ *Note: This section also appears in the documentation, but here are complete examples ready to use with your bot credentials.*
21
+
22
+ ### Installation
23
+ To install the ScurryPy package, run:
24
+ ```bash
25
+ pip install scurrypy
26
+ ```
27
+
28
+ ### Minimal Slash Command
29
+ The following demonstrates building and responding to a slash command.
30
+
31
+ *Note: Adjust `dotenv_path` if your `.env` file is not in the same directory as this script.*
32
+
33
+ ```python
34
+ import discord, os
35
+ from dotenv import load_dotenv
36
+
37
+ load_dotenv(dotenv_path='./path/to/env')
38
+
39
+ client = discord.Client(
40
+ token=os.getenv("DISCORD_TOKEN"),
41
+ application_id=APPLICATION_ID # replace with your bot's user ID
42
+ )
43
+
44
+ @client.command(
45
+ command=discord.SlashCommand(
46
+ name='example',
47
+ description='Demonstrate the minimal slash command!'
48
+ ),
49
+ guild_id=GUILD_ID # must be a guild ID your bot is in
50
+ )
51
+ async def example(bot: discord.Client, event: discord.InteractionEvent):
52
+ await event.interaction.respond(f'Hello, {event.interaction.member.user.username}!')
53
+
54
+ client.run()
55
+ ```
56
+
57
+ ### Minimal Prefix Command (Legacy)
58
+ The following demonstrates building and responding to a message prefix command.
59
+
60
+ ```python
61
+ import discord, os
62
+ from dotenv import load_dotenv
63
+
64
+ load_dotenv(dotenv_path='./path/to/env')
65
+
66
+ client = discord.Client(
67
+ token=os.getenv("DISCORD_TOKEN"),
68
+ application_id=APPLICATION_ID, # replace with your bot's user ID
69
+ intents=discord.set_intents(message_content=True),
70
+ prefix='!' # your custom prefix
71
+ )
72
+
73
+ @client.prefix_command
74
+ async def ping(bot: discord.Client, event: discord.MessageCreateEvent):
75
+ # The function name is the name of the command
76
+ await event.message.send("Pong!")
77
+
78
+ client.run()
79
+ ```
80
+
81
+ ## Like what you see?
82
+ Check out the full [documentation](https://furmissile.github.io/scurrypy) for more examples, guides, and API reference!
@@ -0,0 +1,223 @@
1
+ # discord
2
+
3
+ import importlib
4
+ from typing import TYPE_CHECKING
5
+
6
+ __all__ = [
7
+ # top-level
8
+ "Logger",
9
+ "Client",
10
+ "Intents",
11
+ "set_intents",
12
+ "BaseConfig",
13
+
14
+ # events
15
+ "ReadyEvent",
16
+ "ReactionAddEvent",
17
+ "ReactionRemoveEvent",
18
+ "ReactionRemoveEmojiEvent",
19
+ "ReactionRemoveAllEvent",
20
+ "GuildCreateEvent",
21
+ "GuildUpdateEvent",
22
+ "GuildDeleteEvent",
23
+ "MessageCreateEvent",
24
+ "MessageUpdateEvent",
25
+ "MessageDeleteEvent",
26
+ "GuildChannelCreateEvent",
27
+ "GuildChannelUpdateEvent",
28
+ "GuildChannelDeleteEvent",
29
+ "ChannelPinsUpdateEvent",
30
+ "InteractionEvent",
31
+
32
+ # models
33
+ "ApplicationModel",
34
+ "EmojiModel",
35
+ "GuildModel",
36
+ "MemberModel",
37
+ "UserModel",
38
+ "RoleModel",
39
+
40
+ # parts
41
+ "GuildChannel",
42
+ "Role",
43
+ "MessageBuilder",
44
+ "ModalBuilder",
45
+ "EmbedBuilder",
46
+ "ActionRow",
47
+ "StringSelect",
48
+ "UserSelect",
49
+ "RoleSelect",
50
+ "ChannelSelect",
51
+ "MentionableSelect",
52
+ "SlashCommand",
53
+ "MessageCommand",
54
+ "UserCommand",
55
+ "Container",
56
+ "Section",
57
+ "MediaGalleryItem",
58
+ "Label",
59
+
60
+ # resources
61
+ "Guild",
62
+ "Channel",
63
+ "Message",
64
+ "BotEmojis",
65
+ "User",
66
+ "Interaction",
67
+ "Application",
68
+ ]
69
+
70
+ # For editor support / autocomplete
71
+ if TYPE_CHECKING:
72
+ from .logger import Logger
73
+ from .client import Client
74
+ from .intents import Intents, set_intents
75
+ from .config import BaseConfig
76
+
77
+ # events
78
+ from .events.ready_event import ReadyEvent
79
+ from .events.reaction_events import (
80
+ ReactionAddEvent,
81
+ ReactionRemoveEvent,
82
+ ReactionRemoveEmojiEvent,
83
+ ReactionRemoveAllEvent,
84
+ )
85
+ from .events.guild_events import (
86
+ GuildCreateEvent,
87
+ GuildUpdateEvent,
88
+ GuildDeleteEvent,
89
+ )
90
+ from .events.message_events import (
91
+ MessageCreateEvent,
92
+ MessageUpdateEvent,
93
+ MessageDeleteEvent,
94
+ )
95
+ from .events.channel_events import (
96
+ GuildChannelCreateEvent,
97
+ GuildChannelUpdateEvent,
98
+ GuildChannelDeleteEvent,
99
+ ChannelPinsUpdateEvent,
100
+ )
101
+ from .events.interaction_events import InteractionEvent
102
+
103
+ # models
104
+ from .models.application import ApplicationModel
105
+ from .models.emoji import EmojiModel
106
+ from .models.guild import GuildModel
107
+ from .models.member import MemberModel
108
+ from .models.user import UserModel
109
+ from .models.role import RoleModel
110
+
111
+ # parts
112
+ from .parts.channel import GuildChannel
113
+ from .parts.role import Role
114
+ from .parts.message import MessageBuilder
115
+ from .parts.modal import ModalBuilder
116
+ from .parts.embed import EmbedBuilder
117
+ from .parts.action_row import (
118
+ ActionRow,
119
+ StringSelect,
120
+ UserSelect,
121
+ RoleSelect,
122
+ ChannelSelect,
123
+ MentionableSelect
124
+ )
125
+
126
+ from .parts.command import (
127
+ SlashCommand,
128
+ MessageCommand,
129
+ UserCommand
130
+ )
131
+
132
+ from .parts.components_v2 import (
133
+ Container,
134
+ Section,
135
+ MediaGalleryItem,
136
+ Label
137
+ )
138
+
139
+ # resources
140
+ from .resources.guild import Guild
141
+ from .resources.channel import Channel
142
+ from .resources.message import Message
143
+ from .resources.bot_emojis import BotEmojis
144
+ from .resources.user import User
145
+ from .resources.interaction import Interaction
146
+ from .resources.application import Application
147
+
148
+ # Lazy loader
149
+ def __getattr__(name: str):
150
+ if name not in __all__:
151
+ raise AttributeError(f"module {__name__} has no attribute {name}")
152
+
153
+ mapping = {
154
+ # top-level
155
+ "Logger": "discord.logger",
156
+ "Client": "discord.client",
157
+ "Intents": "discord.intents",
158
+ "set_intents": "discord.intents",
159
+ "BaseConfig": "discord.config",
160
+
161
+ # events
162
+ "ReadyEvent": "discord.events.ready_event",
163
+ "ReactionAddEvent": "discord.events.reaction_events",
164
+ "ReactionRemoveEvent": "discord.events.reaction_events",
165
+ "ReactionRemoveEmojiEvent": "discord.events.reaction_events",
166
+ "ReactionRemoveAllEvent": "discord.events.reaction_events",
167
+ "GuildCreateEvent": "discord.events.guild_events",
168
+ "GuildUpdateEvent": "discord.events.guild_events",
169
+ "GuildDeleteEvent": "discord.events.guild_events",
170
+ "MessageCreateEvent": "discord.events.message_events",
171
+ "MessageUpdateEvent": "discord.events.message_events",
172
+ "MessageDeleteEvent": "discord.events.message_events",
173
+ "GuildChannelCreateEvent": "discord.events.channel_events",
174
+ "GuildChannelUpdateEvent": "discord.events.channel_events",
175
+ "GuildChannelDeleteEvent": "discord.events.channel_events",
176
+ "ChannelPinsUpdateEvent": "discord.events.channel_events",
177
+ "InteractionEvent": "discord.events.interaction_events",
178
+
179
+ # models
180
+ 'ApplicationModel': "discord.models.application",
181
+ 'EmojiModel': "discord.models.emoji",
182
+ 'GuildModel': "discord.models.guild",
183
+ 'MemberModel': "discord.models.member",
184
+ 'UserModel': "discord.models.user",
185
+ 'RoleModel': "discord.models.role",
186
+
187
+ # parts
188
+ 'GuildChannel': "discord.parts.channel",
189
+ 'Role': "discord.parts.role",
190
+ 'MessageBuilder': "discord.parts.message",
191
+ 'ModalBuilder': "discord.parts.modal",
192
+ 'EmbedBuilder': "discord.parts.embed",
193
+ 'ActionRow': "discord.parts.action_row",
194
+ 'StringSelect': "discord.parts.action_row",
195
+ 'UserSelect': "discord.parts.action_row",
196
+ 'RoleSelect': "discord.parts.action_row",
197
+ 'ChannelSelect': "discord.parts.action_row",
198
+ 'MentionableSelect': "discord.parts.action_row",
199
+ 'SlashCommand': "discord.parts.command",
200
+ 'MessageCommand': "discord.parts.command",
201
+ 'UserCommand': "discord.parts.command",
202
+ 'Container': "discord.parts.components_v2",
203
+ 'Section': "discord.parts.components_v2",
204
+ 'MediaGalleryItem': "discord.parts.components_v2",
205
+ 'Label': "discord.parts.components_v2",
206
+
207
+ # resources
208
+ 'Guild': "discord.resources.guild",
209
+ 'Channel': "discord.resources.channel",
210
+ 'Message': "discord.resources.message",
211
+ 'BotEmojis': "discord.resources.bot_emojis",
212
+ 'User': "discord.resources.user",
213
+ 'Interaction': "discord.resources.interaction",
214
+ 'Application': "discord.resources.application"
215
+ }
216
+
217
+ module = importlib.import_module(mapping[name])
218
+ attr = getattr(module, name)
219
+ globals()[name] = attr # cache it for future lookups
220
+ return attr
221
+
222
+ def __dir__():
223
+ return sorted(list(globals().keys()) + __all__)