From 1deb5bf82dcc5f18c4724341c150e1d9cb71293c Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Sat, 20 May 2023 06:07:03 +0530 Subject: [PATCH] [commands] Add Context.filesize_limit property --- discord/ext/commands/context.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index 92a1a6b51..ee34e1275 100644 --- a/discord/ext/commands/context.py +++ b/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."""