Skip to content

Commit f00208c

Browse files
committed
feat: add rate limit per user where needed
1 parent c5c5045 commit f00208c

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
@@ -240,6 +240,8 @@ class MessageableMixin(SendMixin):
240240
repr=False, default=None, converter=optional_c(timestamp_converter)
241241
)
242242
"""When the last pinned message was pinned. This may be None when a message is not pinned."""
243+
rate_limit_per_user: int = attrs.field(repr=False, default=0)
244+
"""Amount of seconds a user has to wait before sending another message (0-21600)"""
243245

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

16971697
async def edit(
16981698
self,
@@ -2394,6 +2394,8 @@ class GuildForum(GuildChannel):
23942394
"""The default emoji to react with for posts"""
23952395
last_message_id: Optional[Snowflake_Type] = attrs.field(repr=False, default=None)
23962396
# TODO: Implement "template" once the API supports them
2397+
rate_limit_per_user: int = attrs.field(repr=False, default=0)
2398+
"""Amount of seconds a user has to wait before sending another message (0-21600)"""
23972399

23982400
@classmethod
23992401
def _process_dict(cls, data: Dict[str, Any], client: "Client") -> Dict[str, Any]:

0 commit comments

Comments
 (0)