@@ -374,7 +374,6 @@ async def invoke(self, ctx: ApplicationContext) -> None:
374
374
await injected (ctx )
375
375
376
376
async def can_run (self , ctx : ApplicationContext ) -> bool :
377
-
378
377
if not await ctx .bot .can_run (ctx ):
379
378
raise CheckFailure (
380
379
f"The global check functions for command { self .name } failed."
@@ -1822,7 +1821,8 @@ def validate_chat_input_name(name: Any, locale: str | None = None):
1822
1821
# Must meet the regex ^[-_\w\d\u0901-\u097D\u0E00-\u0E7F]{1,32}$
1823
1822
if locale is not None and locale not in valid_locales :
1824
1823
raise ValidationError (
1825
- f"Locale '{ locale } ' is not a valid locale, see { docs } /reference#locales for list of supported locales."
1824
+ f"Locale '{ locale } ' is not a valid locale, see { docs } /reference#locales for"
1825
+ " list of supported locales."
1826
1826
)
1827
1827
error = None
1828
1828
if not isinstance (name , str ):
@@ -1831,8 +1831,10 @@ def validate_chat_input_name(name: Any, locale: str | None = None):
1831
1831
)
1832
1832
elif not re .match (r"^[-_\w\d\u0901-\u097D\u0E00-\u0E7F]{1,32}$" , name ):
1833
1833
error = ValidationError (
1834
- r"Command names and options must follow the regex \"^[-_\w\d\u0901-\u097D\u0E00-\u0E7F]{1,32}$\". "
1835
- f"For more information, see { docs } /interactions/application-commands#application-command-object-"
1834
+ r"Command names and options must follow the regex"
1835
+ r" \"^[-_\w\d\u0901-\u097D\u0E00-\u0E7F]{1,32}$\". "
1836
+ "For more information, see"
1837
+ f" { docs } /interactions/application-commands#application-command-object-"
1836
1838
f'application-command-naming. Received "{ name } "'
1837
1839
)
1838
1840
elif (
@@ -1851,16 +1853,19 @@ def validate_chat_input_name(name: Any, locale: str | None = None):
1851
1853
def validate_chat_input_description (description : Any , locale : str | None = None ):
1852
1854
if locale is not None and locale not in valid_locales :
1853
1855
raise ValidationError (
1854
- f"Locale '{ locale } ' is not a valid locale, see { docs } /reference#locales for list of supported locales."
1856
+ f"Locale '{ locale } ' is not a valid locale, see { docs } /reference#locales for"
1857
+ " list of supported locales."
1855
1858
)
1856
1859
error = None
1857
1860
if not isinstance (description , str ):
1858
1861
error = TypeError (
1859
- f'Command and option description must be of type str. Received "{ description } "'
1862
+ "Command and option description must be of type str. Received"
1863
+ f' "{ description } "'
1860
1864
)
1861
1865
elif not 1 <= len (description ) <= 100 :
1862
1866
error = ValidationError (
1863
- f'Command and option description must be 1-100 characters long. Received "{ description } "'
1867
+ "Command and option description must be 1-100 characters long. Received"
1868
+ f' "{ description } "'
1864
1869
)
1865
1870
1866
1871
if error :
0 commit comments