File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,20 @@ async def safe_close(
5252 """
5353 modifiers = {'silently' , 'silent' , 'cancel' }
5454
55- argument_passed = bool (after )
56- not_a_modifier = after .arg not in modifiers
55+ argument_passed = after is not None
5756
58- if argument_passed and not_a_modifier and after .arg == after .raw :
57+ if argument_passed :
58+ not_a_modifier = after .arg not in modifiers
59+
60+ # These changes are always made to the argument by the super
61+ # class so they need to be replicated before the raw argument
62+ # is compared with the parsed message.
63+ stripped_argument = after .raw .strip ()
64+ argument_without_phrases = stripped_argument .removeprefix ('in ' ).removesuffix (' from now' )
65+
66+ no_duration = after .arg == argument_without_phrases
67+
68+ if argument_passed and not_a_modifier and no_duration :
5969 # Ask for confirmation since only a close message was provided.
6070 await close_after_confirmation (ctx , after )
6171 else :
You can’t perform that action at this time.
0 commit comments