@@ -284,22 +284,43 @@ async def snippet_edit(self, ctx, name: str.lower, *, value):
284
284
embed = create_not_found_embed (name , self .bot .snippets .keys (), "Snippet" )
285
285
await ctx .send (embed = embed )
286
286
287
- @commands .command ()
287
+ @commands .command (usage = '<category> [options]' )
288
288
@checks .has_permissions (PermissionLevel .MODERATOR )
289
289
@checks .thread_only ()
290
- async def move (self , ctx , category : discord . CategoryChannel , * , specifics : str = None ):
290
+ async def move (self , ctx , * , arguments ):
291
291
"""
292
292
Move a thread to another category.
293
293
294
294
`category` may be a category ID, mention, or name.
295
- `specifics ` is a string which takes in arguments on how to perform the move. Ex: "silently"
295
+ `options ` is a string which takes in arguments on how to perform the move. Ex: "silently"
296
296
"""
297
+ split_args = arguments .strip ('"' ).split (' ' )
298
+
299
+ # manually parse arguments, consumes as much of args as possible for category
300
+ for i in range (len (split_args )):
301
+ try :
302
+ if i == 0 :
303
+ fmt = arguments
304
+ else :
305
+ fmt = ' ' .join (split_args [:- i ])
306
+
307
+ category = await commands .CategoryChannelConverter ().convert (ctx , fmt )
308
+ except commands .BadArgument :
309
+ if i == len (split_args ) - 1 :
310
+ # last one
311
+ raise
312
+ pass
313
+ else :
314
+ break
315
+
316
+ options = ' ' .join (arguments .split (' ' )[- i :])
317
+
297
318
thread = ctx .thread
298
319
silent = False
299
320
300
- if specifics :
321
+ if options :
301
322
silent_words = ["silent" , "silently" ]
302
- silent = any (word in silent_words for word in specifics .split ())
323
+ silent = any (word in silent_words for word in options .split ())
303
324
304
325
await thread .channel .edit (category = category , sync_permissions = True )
305
326
0 commit comments