mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21:02:38 +00:00
Optimized arg cleaning
This commit is contained in:
parent
6ee7a251d4
commit
e74a3b0bc3
1 changed files with 8 additions and 10 deletions
|
@ -117,19 +117,17 @@ def get_kwargs(ctx, args, *, limit=False):
|
||||||
rm = False
|
rm = False
|
||||||
lim = 1
|
lim = 1
|
||||||
|
|
||||||
if '-d' in remaining or '-dm' in remaining:
|
for flag in ('-d', '-dm'):
|
||||||
destination = ctx.author
|
if flag in remaining:
|
||||||
|
destination = ctx.author
|
||||||
|
|
||||||
for flag in ('-d', '-dm'):
|
remaining.remove(flag)
|
||||||
with suppress(ValueError):
|
|
||||||
remaining.remove(flag)
|
|
||||||
|
|
||||||
if ('-r' in remaining or '-rm' in remaining or '-remove' in remaining) and ctx.author.permissions_in(ctx.channel).manage_messages:
|
for flag in ('-r', '-rm', '-remove', '-re', '-repl', '-replace'):
|
||||||
rm = True
|
if flag in remaining and ctx.author.permissions_in(ctx.channel).manage_messages:
|
||||||
|
rm = True
|
||||||
|
|
||||||
for flag in ('-r', '-rm', '-remove'):
|
remaining.remove(flag)
|
||||||
with suppress(ValueError):
|
|
||||||
remaining.remove(flag)
|
|
||||||
|
|
||||||
if limit:
|
if limit:
|
||||||
for arg in remaining:
|
for arg in remaining:
|
||||||
|
|
Loading…
Reference in a new issue