@@ -47,17 +47,17 @@ def _translate_args(args: Args) -> list[AnyCommandOption]:
4747 if all (isinstance (x , str ) for x in arg .value .base ):
4848 result .append (
4949 StringOption (
50- name = arg .name ,
51- description = arg .notice or arg .name ,
50+ name = f" { arg .name } " ,
51+ description = f" { arg .notice or arg .name } " ,
5252 required = not arg .optional ,
5353 choices = [OptionChoice (name = x , value = x ) for x in arg .value .base ], # type: ignore # noqa: E501
5454 )
5555 )
5656 elif all (isinstance (x , int ) for x in arg .value .base ):
5757 result .append (
5858 IntegerOption (
59- name = arg .name ,
60- description = arg .notice or arg .name ,
59+ name = f" { arg .name } " ,
60+ description = f" { arg .notice or arg .name } " ,
6161 required = not arg .optional ,
6262 choices = [
6363 OptionChoice (name = str (x ), value = x ) for x in arg .value .base # type: ignore # noqa: E501
@@ -67,8 +67,8 @@ def _translate_args(args: Args) -> list[AnyCommandOption]:
6767 elif all (isinstance (x , float ) for x in arg .value .base ):
6868 result .append (
6969 NumberOption (
70- name = arg .name ,
71- description = arg .notice or arg .name ,
70+ name = f" { arg .name } " ,
71+ description = f" { arg .notice or arg .name } " ,
7272 required = not arg .optional ,
7373 choices = [
7474 OptionChoice (name = str (x ), value = x ) for x in arg .value .base # type: ignore # noqa: E501
@@ -78,8 +78,8 @@ def _translate_args(args: Args) -> list[AnyCommandOption]:
7878 else :
7979 result .append (
8080 StringOption (
81- name = arg .name ,
82- description = arg .notice or arg .name ,
81+ name = f" { arg .name } " ,
82+ description = f" { arg .notice or arg .name } " ,
8383 required = not arg .optional ,
8484 choices = [OptionChoice (name = str (x ), value = str (x )) for x in arg .value .base ],
8585 )
@@ -88,88 +88,88 @@ def _translate_args(args: Args) -> list[AnyCommandOption]:
8888 if arg .value == ANY :
8989 result .append (
9090 StringOption (
91- name = arg .name ,
92- description = arg .notice or arg .name ,
91+ name = f" { arg .name } " ,
92+ description = f" { arg .notice or arg .name } " ,
9393 required = not arg .optional ,
9494 )
9595 )
9696 elif arg .value == INTEGER :
9797 result .append (
9898 IntegerOption (
99- name = arg .name ,
100- description = arg .notice or arg .name ,
99+ name = f" { arg .name } " ,
100+ description = f" { arg .notice or arg .name } " ,
101101 required = not arg .optional ,
102102 )
103103 )
104104 elif arg .value in (FLOAT , NUMBER ):
105105 result .append (
106106 NumberOption (
107- name = arg .name ,
108- description = arg .notice or arg .name ,
107+ name = f" { arg .name } " ,
108+ description = f" { arg .notice or arg .name } " ,
109109 required = not arg .optional ,
110110 )
111111 )
112112 elif arg .value .origin is str :
113113 result .append (
114114 StringOption (
115- name = arg .name ,
116- description = arg .notice or arg .name ,
115+ name = f" { arg .name } " ,
116+ description = f" { arg .notice or arg .name } " ,
117117 required = not arg .optional ,
118118 )
119119 )
120120 elif arg .value .origin is bool :
121121 result .append (
122122 BooleanOption (
123- name = arg .name ,
124- description = arg .notice or arg .name ,
123+ name = f" { arg .name } " ,
124+ description = f" { arg .notice or arg .name } " ,
125125 required = not arg .optional ,
126126 )
127127 )
128128 elif arg .value is Image :
129129 result .append (
130130 AttachmentOption (
131- name = arg .name ,
132- description = arg .notice or arg .name ,
131+ name = f" { arg .name } " ,
132+ description = f" { arg .notice or arg .name } " ,
133133 required = not arg .optional ,
134134 )
135135 )
136136 # elif arg.value == MentionUser:
137137 # result.append(
138138 # UserOption(
139- # name=arg.name,
140- # description=arg.notice or arg.name,
139+ # name=f"{ arg.name}" ,
140+ # description=f"{ arg.notice or arg.name}" ,
141141 # required=not arg.optional,
142142 # )
143143 # )
144144 # elif arg.value == MentionChannel:
145145 # result.append(
146146 # ChannelOption(
147- # name=arg.name,
148- # description=arg.notice or arg.name,
147+ # name=f"{ arg.name}" ,
148+ # description=f"{ arg.notice or arg.name}" ,
149149 # required=not arg.optional,
150150 # )
151151 # )
152152 # elif arg.value == MentionRole:
153153 # result.append(
154154 # RoleOption(
155- # name=arg.name,
156- # description=arg.notice or arg.name,
155+ # name=f"{ arg.name}" ,
156+ # description=f"{ arg.notice or arg.name}" ,
157157 # required=not arg.optional,
158158 # )
159159 # )
160160 elif arg .value .origin is At :
161161 result .append (
162162 MentionableOption (
163- name = arg .name ,
164- description = arg .notice or arg .name ,
163+ name = f" { arg .name } " ,
164+ description = f" { arg .notice or arg .name } " ,
165165 required = not arg .optional ,
166166 )
167167 )
168168 else :
169169 result .append (
170170 StringOption (
171- name = arg .name ,
172- description = arg .notice or arg .name ,
171+ name = f" { arg .name } " ,
172+ description = f" { arg .notice or arg .name } " ,
173173 required = not arg .optional ,
174174 )
175175 )
@@ -179,8 +179,8 @@ def _translate_args(args: Args) -> list[AnyCommandOption]:
179179def _translate_options (opt : Union [Option , Subcommand ]) -> Union [SubCommandGroupOption , SubCommandOption ]:
180180 if isinstance (opt , Option ):
181181 return SubCommandOption (
182- name = opt .name ,
183- description = opt .help_text ,
182+ name = f" { opt .name } " ,
183+ description = f" { opt .help_text } " ,
184184 options = _translate_args (opt .args ), # type: ignore
185185 )
186186 if not opt .args .empty and opt .options :
@@ -190,11 +190,11 @@ def _translate_options(opt: Union[Option, Subcommand]) -> Union[SubCommandGroupO
190190 )
191191 if not opt .args .empty :
192192 return SubCommandOption (
193- name = opt .name , description = opt .help_text , options = _translate_args (opt .args ) # type: ignore
193+ name = f" { opt .name } " , description = f" { opt .help_text } " , options = _translate_args (opt .args ) # type: ignore
194194 )
195195 return SubCommandGroupOption (
196- name = opt .name ,
197- description = opt .help_text ,
196+ name = f" { opt .name } " ,
197+ description = f" { opt .help_text } " ,
198198 options = [_translate_options (sub ) for sub in opt .options ], # type: ignore
199199 )
200200
@@ -234,8 +234,8 @@ def translate(
234234 if not (options := _translate_args (alc .args )):
235235 options = [_translate_options (opt ) for opt in allow_opt ]
236236 buffer = {
237- "name" : alc .command ,
238- "description" : alc .meta .description ,
237+ "name" : f" { alc .command } " ,
238+ "description" : f" { alc .meta .description } " ,
239239 "options" : options ,
240240 ** locals (),
241241 }
0 commit comments