Skip to content

Commit c229ce1

Browse files
authored
feat: add rate limit per user where needed (#1489)
Signed-off-by: LordOfPolls <dev@lordofpolls.com>
1 parent 6a2d8e6 commit c229ce1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

interactions/models/discord/channel.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ class MessageableMixin(SendMixin):
242242
repr=False, default=None, converter=optional_c(timestamp_converter)
243243
)
244244
"""When the last pinned message was pinned. This may be None when a message is not pinned."""
245+
rate_limit_per_user: int = attrs.field(repr=False, default=0)
246+
"""Amount of seconds a user has to wait before sending another message (0-21600)"""
245247

246248
async def _send_http_request(
247249
self, message_payload: Union[dict, "FormData"], files: list["UPLOADABLE_TYPE"] | None = None
@@ -1693,8 +1695,6 @@ async def create_thread_from_message(
16931695
class GuildText(GuildChannel, MessageableMixin, InvitableMixin, ThreadableMixin, WebhookMixin):
16941696
topic: Optional[str] = attrs.field(repr=False, default=None)
16951697
"""The channel topic (0-1024 characters)"""
1696-
rate_limit_per_user: int = attrs.field(repr=False, default=0)
1697-
"""Amount of seconds a user has to wait before sending another message (0-21600)"""
16981698

16991699
async def edit(
17001700
self,
@@ -2396,6 +2396,8 @@ class GuildForum(GuildChannel):
23962396
"""The default emoji to react with for posts"""
23972397
last_message_id: Optional[Snowflake_Type] = attrs.field(repr=False, default=None)
23982398
# TODO: Implement "template" once the API supports them
2399+
rate_limit_per_user: int = attrs.field(repr=False, default=0)
2400+
"""Amount of seconds a user has to wait before sending another message (0-21600)"""
23992401
default_sort_order: Optional[ForumSortOrder] = attrs.field(
24002402
repr=False, default=None, converter=ForumSortOrder.converter
24012403
)

0 commit comments

Comments
 (0)