talkomatic.py 0.1.2
An easy-to-use Python versatile wrapper for the Talkomatic Bot interface ensuring best practices for making bots, and handling the REST API.
 
Loading...
Searching...
No Matches
rate_limits.py
Go to the documentation of this file.
1from dataclasses import dataclass
2
3
4@dataclass
6 """
7 A class representing the rate limits of bot actions
8 (to prevent get blocked by the API).
9
10 The original server's limits are:
11 - 1000 requests per minute
12 - 30 second cooldown on creating rooms
13 - message length and frequency limits
14
15 Composed of:
16 - message_cooldown: The cooldown in seconds between messages.
17 - room_join_cooldown: The cooldown in seconds between joining rooms.
18 - room_creation_cooldown: The cooldown in seconds between creating rooms.
19 """
20
21 message_cooldown: float = 0.1
22 room_join_cooldown: float = 5
23 room_creation_cooldown: float = 30
24
25DISABLE_RATE_LIMITS = RateLimits(message_cooldown = 0, room_join_cooldown = 0, room_creation_cooldown = 0)
26
27__all__ = ["RateLimits", "DISABLE_RATE_LIMITS"]