Browse Source

Add constant for the default file size limit

pull/9422/head
Rapptz 2 years ago
parent
commit
e870bb1335
  1. 2
      discord/ext/commands/context.py
  2. 6
      discord/guild.py
  3. 1
      discord/utils.py

2
discord/ext/commands/context.py

@ -436,7 +436,7 @@ class Context(discord.abc.Messageable, Generic[BotT]):
.. versionadded:: 2.3
"""
return self.guild.filesize_limit if self.guild is not None else 26214400
return self.guild.filesize_limit if self.guild is not None else discord.utils.DEFAULT_FILE_SIZE_LIMIT_BYTES
@discord.utils.cached_property
def guild(self) -> Optional[Guild]:

6
discord/guild.py

@ -324,9 +324,9 @@ class Guild(Hashable):
)
_PREMIUM_GUILD_LIMITS: ClassVar[Dict[Optional[int], _GuildLimit]] = {
None: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=26214400),
0: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=26214400),
1: _GuildLimit(emoji=100, stickers=15, bitrate=128e3, filesize=26214400),
None: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=utils.DEFAULT_FILE_SIZE_LIMIT_BYTES),
0: _GuildLimit(emoji=50, stickers=5, bitrate=96e3, filesize=utils.DEFAULT_FILE_SIZE_LIMIT_BYTES),
1: _GuildLimit(emoji=100, stickers=15, bitrate=128e3, filesize=utils.DEFAULT_FILE_SIZE_LIMIT_BYTES),
2: _GuildLimit(emoji=150, stickers=30, bitrate=256e3, filesize=52428800),
3: _GuildLimit(emoji=250, stickers=60, bitrate=384e3, filesize=104857600),
}

1
discord/utils.py

@ -100,6 +100,7 @@ __all__ = (
)
DISCORD_EPOCH = 1420070400000
DEFAULT_FILE_SIZE_LIMIT_BYTES = 26214400
class _MissingSentinel:

Loading…
Cancel
Save