Skip to content

Commit

Permalink
Add constant for the default file size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed May 20, 2023
1 parent 8d583ea commit e870bb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion discord/ext/commands/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def filesize_limit(self) -> int:
.. 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]:
Expand Down
6 changes: 3 additions & 3 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
1 change: 1 addition & 0 deletions discord/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
)

DISCORD_EPOCH = 1420070400000
DEFAULT_FILE_SIZE_LIMIT_BYTES = 26214400


class _MissingSentinel:
Expand Down

0 comments on commit e870bb1

Please sign in to comment.