Browse Source
[commands] Add Context.filesize_limit property
pull/9422/head
owocado
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
0 deletions
-
discord/ext/commands/context.py
|
|
@ -430,6 +430,14 @@ class Context(discord.abc.Messageable, Generic[BotT]): |
|
|
|
return None |
|
|
|
return self.command.cog |
|
|
|
|
|
|
|
@property |
|
|
|
def filesize_limit(self) -> int: |
|
|
|
""":class:`int`: Returns the maximum number of bytes files can have when uploaded to this guild or DM channel associated with this context. |
|
|
|
|
|
|
|
.. versionadded:: 2.3 |
|
|
|
""" |
|
|
|
return self.guild.filesize_limit if self.guild is not None else 26214400 |
|
|
|
|
|
|
|
@discord.utils.cached_property |
|
|
|
def guild(self) -> Optional[Guild]: |
|
|
|
"""Optional[:class:`.Guild`]: Returns the guild associated with this context's command. None if not available.""" |
|
|
|