fix: cap cache_url at 100 MiB, the largest upload a bot can make
bots can't have nitro, so discord's largest upload a bot can make is a boost tier 3 guild's 104857600 bytes (discord.py Guild.filesize_limit). 500 MiB admitted bodies no bot upload could carry. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
1 parent
40d38661d1
commit
caf0c3ee5c
1 file changed
+4
-3
@@ -61,9 +61,10 @@ import discord
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
MAX_ATTACHMENTS_PER_MESSAGE = 10
|
MAX_ATTACHMENTS_PER_MESSAGE = 10
|
||||||
# cache_url's body cap: discord's largest upload tier (500 MB, nitro), so nothing discord would
|
# cache_url's body cap: the largest upload a BOT can make (boost tier 3 guild,
|
||||||
# accept is refused; it bounds memory, it is not the bot's real (per-guild) upload limit
|
# discord.py Guild.filesize_limit 104857600; bots can't have nitro), so nothing discord would
|
||||||
MAX_CACHE_URL_BYTES = 500 * 1024 * 1024
|
# accept from a bot is refused; it bounds memory, not the channel's own (tier) limit
|
||||||
|
MAX_CACHE_URL_BYTES = 100 * 1024 * 1024
|
||||||
|
|
||||||
FileContent = Union[bytes, bytearray, str, "os.PathLike[str]", discord.File]
|
FileContent = Union[bytes, bytearray, str, "os.PathLike[str]", discord.File]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user