Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
wantzel
Commits
fb529b59
Commit
fb529b59
authored
Feb 16, 2016
by
Mindiell
Browse files
Fixing some more old command starters.
parent
af631a0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
wantzel.py
View file @
fb529b59
...
@@ -383,11 +383,11 @@ class Wantzel(object):
...
@@ -383,11 +383,11 @@ class Wantzel(object):
def
admin
(
self
,
user
,
channel
,
msg
):
def
admin
(
self
,
user
,
channel
,
msg
):
"""
"""
Manage moderation.
Manage moderation.
A sub-command should be behind the
!
admin command.
A sub-command should be behind the
~
admin command.
"""
"""
Utils
.
debug
(
"admin command"
)
Utils
.
debug
(
"admin command"
)
# Searching for a command after admin keyword
# Searching for a command after admin keyword
command
=
re
.
search
(
"
!
admin (list|add|del)"
,
msg
)
command
=
re
.
search
(
"
~
admin (list|add|del)"
,
msg
)
if
command
:
if
command
:
command
=
command
.
group
(
1
)
command
=
command
.
group
(
1
)
if
command
==
"list"
:
if
command
==
"list"
:
...
@@ -420,7 +420,7 @@ class Wantzel(object):
...
@@ -420,7 +420,7 @@ class Wantzel(object):
try
:
try
:
names
=
[]
names
=
[]
connection
=
sqlite3
.
connect
(
config
.
sqlite_db
)
connection
=
sqlite3
.
connect
(
config
.
sqlite_db
)
result
=
re
.
search
(
"
!
admin add (([^,]+, ?)+)?(.*)"
,
msg
)
result
=
re
.
search
(
"
~
admin add (([^,]+, ?)+)?(.*)"
,
msg
)
if
result
.
group
(
1
):
if
result
.
group
(
1
):
names
=
[
name
for
name
in
result
.
group
(
1
).
split
(
", "
)
if
name
!=
""
]
names
=
[
name
for
name
in
result
.
group
(
1
).
split
(
", "
)
if
name
!=
""
]
names
.
append
(
result
.
group
(
3
))
names
.
append
(
result
.
group
(
3
))
...
@@ -450,7 +450,7 @@ class Wantzel(object):
...
@@ -450,7 +450,7 @@ class Wantzel(object):
if
is_moderator
(
user
):
if
is_moderator
(
user
):
try
:
try
:
names
=
[]
names
=
[]
result
=
re
.
search
(
"
!
admin del (([^,]+, ?)+)?(.*)"
,
msg
)
result
=
re
.
search
(
"
~
admin del (([^,]+, ?)+)?(.*)"
,
msg
)
if
result
.
group
(
1
):
if
result
.
group
(
1
):
names
=
[
name
for
name
in
result
.
group
(
1
).
split
(
", "
)
if
name
!=
""
]
names
=
[
name
for
name
in
result
.
group
(
1
).
split
(
", "
)
if
name
!=
""
]
names
.
append
(
result
.
group
(
3
))
names
.
append
(
result
.
group
(
3
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment