Quotes in sqlite 2
This commit is contained in:
parent
c17df31655
commit
ad90fefd5e
@ -15,7 +15,7 @@ class Quotes(DatabasePlugin):
|
||||
'irc3.plugins.command',
|
||||
]
|
||||
|
||||
REGEX = re.compile(r'<?[~&@%+]?([a-zA-Z0-9_\-^`|\\\[\]{}]+)>?')
|
||||
NICK_REGEX = re.compile(r'<?[~&@%+]?([a-zA-Z0-9_\-^`|\\\[\]{}]+)>?')
|
||||
|
||||
# noinspection PyUnusedLocal
|
||||
@command(options_first=True)
|
||||
@ -28,11 +28,10 @@ class Quotes(DatabasePlugin):
|
||||
cmd = args.get('<cmd>')
|
||||
nick = args['<nick>']
|
||||
item = args.get('<quote>')
|
||||
print(cmd, nick, item)
|
||||
if cmd and item:
|
||||
if self.guard.has_permission(mask, 'admin'):
|
||||
if cmd == 'add':
|
||||
nick = self.REGEX.match(nick).group(1)
|
||||
nick = self.NICK_REGEX.match(nick).group(1)
|
||||
self.cur.execute('insert into quotes (nick, item) '
|
||||
'values (?, ?)', [nick, ' '.join(item)])
|
||||
if cmd == 'del':
|
||||
|
Loading…
Reference in New Issue
Block a user