33from datetime import datetime , timezone
44from itertools import zip_longest
55import time
6- from typing import Optional , Union , List , Tuple
6+ from typing import Optional , Union , List , Tuple , Literal
77from types import SimpleNamespace
88
99import discord
@@ -1500,9 +1500,9 @@ async def selfcontact(self, ctx):
15001500 async def contact (
15011501 self ,
15021502 ctx ,
1503- users : commands .Greedy [Union [discord .Member , discord .User , discord .Role ]],
1503+ users : commands .Greedy [Union [Literal [ "silent" , "silently" ], discord .Member , discord .User , discord .Role ]],
15041504 * ,
1505- category : Union [ SimilarCategoryConverter , str ] = None ,
1505+ category : SimilarCategoryConverter = None ,
15061506 manual_trigger = True ,
15071507 ):
15081508 """
@@ -1516,16 +1516,22 @@ async def contact(
15161516 A maximum of 5 users are allowed.
15171517 `options` can be `silent` or `silently`.
15181518 """
1519- silent = False
1519+ silent = any (x in users for x in ("silent" , "silently" ))
1520+ if silent :
1521+ try :
1522+ users .remove ("silent" )
1523+ except ValueError :
1524+ pass
1525+
1526+ try :
1527+ users .remove ("silently" )
1528+ except ValueError :
1529+ pass
1530+
1531+ print (users , silent )
15201532 if isinstance (category , str ):
15211533 category = category .split ()
15221534
1523- # just check the last element in the list
1524- if category [- 1 ].lower () in ("silent" , "silently" ):
1525- silent = True
1526- # remove the last element as we no longer need it
1527- category .pop ()
1528-
15291535 category = " " .join (category )
15301536 if category :
15311537 try :
0 commit comments