2626from __future__ import annotations
2727
2828import asyncio
29- from collections .abc import Iterator
3029import datetime
3130import functools
3231import inspect
3332import re
3433import sys
3534import types
3635from collections import OrderedDict
36+ from collections .abc import Iterator
3737from enum import Enum
3838from typing import (
3939 TYPE_CHECKING ,
6666from ..role import Role
6767from ..threads import Thread
6868from ..user import User
69- from ..utils import MISSING , async_all , find , maybe_coroutine , resolve_annotation , utcnow , warn_deprecated
69+ from ..utils import (
70+ MISSING ,
71+ async_all ,
72+ find ,
73+ maybe_coroutine ,
74+ resolve_annotation ,
75+ utcnow ,
76+ warn_deprecated ,
77+ )
7078from .context import ApplicationContext , AutocompleteContext
7179from .options import Option , OptionChoice
7280
@@ -312,7 +320,11 @@ def guild_only(self) -> bool:
312320 "2.6" ,
313321 reference = "https://discord.com/developers/docs/change-log#userinstallable-apps-preview" ,
314322 )
315- return self .contexts is not None and InteractionContextType .guild in self .contexts and len (self .contexts ) == 1
323+ return (
324+ self .contexts is not None
325+ and InteractionContextType .guild in self .contexts
326+ and len (self .contexts ) == 1
327+ )
316328
317329 @guild_only .setter
318330 def guild_only (self , value : bool ) -> None :
@@ -777,7 +789,9 @@ def _validate_parameters(self):
777789 else :
778790 self .options = self ._parse_options (params )
779791
780- def _check_required_params (self , params : OrderedDict [str , inspect .Parameter ]) -> Iterator [tuple [str , inspect .Parameter ]]:
792+ def _check_required_params (
793+ self , params : OrderedDict [str , inspect .Parameter ]
794+ ) -> Iterator [tuple [str , inspect .Parameter ]]:
781795 params_iter = iter (params .items ())
782796 required_params = (
783797 ["self" , "context" ] if self .attached_to_group or self .cog else ["context" ]
@@ -792,7 +806,9 @@ def _check_required_params(self, params: OrderedDict[str, inspect.Parameter]) ->
792806
793807 return params_iter
794808
795- def _parse_options (self , params : OrderedDict [str , inspect .Parameter ], * , check_params : bool = True ) -> list [Option ]:
809+ def _parse_options (
810+ self , params : OrderedDict [str , inspect .Parameter ], * , check_params : bool = True
811+ ) -> list [Option ]:
796812 if check_params :
797813 params_iter = self ._check_required_params (params )
798814 else :
0 commit comments