From f00208c3ed8513154aff8f79aeff9569195de8ca Mon Sep 17 00:00:00 2001 From: LordOfPolls Date: Sat, 15 Jul 2023 09:29:32 +0100 Subject: [PATCH] feat: add rate limit per user where needed --- interactions/models/discord/channel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interactions/models/discord/channel.py b/interactions/models/discord/channel.py index b13125ab0..b68087ea4 100644 --- a/interactions/models/discord/channel.py +++ b/interactions/models/discord/channel.py @@ -240,6 +240,8 @@ class MessageableMixin(SendMixin): repr=False, default=None, converter=optional_c(timestamp_converter) ) """When the last pinned message was pinned. This may be None when a message is not pinned.""" + rate_limit_per_user: int = attrs.field(repr=False, default=0) + """Amount of seconds a user has to wait before sending another message (0-21600)""" async def _send_http_request( self, message_payload: Union[dict, "FormData"], files: list["UPLOADABLE_TYPE"] | None = None @@ -1691,8 +1693,6 @@ async def create_thread_from_message( class GuildText(GuildChannel, MessageableMixin, InvitableMixin, ThreadableMixin, WebhookMixin): topic: Optional[str] = attrs.field(repr=False, default=None) """The channel topic (0-1024 characters)""" - rate_limit_per_user: int = attrs.field(repr=False, default=0) - """Amount of seconds a user has to wait before sending another message (0-21600)""" async def edit( self, @@ -2394,6 +2394,8 @@ class GuildForum(GuildChannel): """The default emoji to react with for posts""" last_message_id: Optional[Snowflake_Type] = attrs.field(repr=False, default=None) # TODO: Implement "template" once the API supports them + rate_limit_per_user: int = attrs.field(repr=False, default=0) + """Amount of seconds a user has to wait before sending another message (0-21600)""" @classmethod def _process_dict(cls, data: Dict[str, Any], client: "Client") -> Dict[str, Any]: