1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00

support quotes

This commit is contained in:
Thorsten
2016-01-03 18:37:48 +01:00
parent 3d59f1d55e
commit d87ccb3777

View File

@@ -4,6 +4,7 @@
The URLBot - ready to strive for desaster in YOUR jabber MUC The URLBot - ready to strive for desaster in YOUR jabber MUC
""" """
import re import re
import shlex
import sys import sys
import time import time
from lxml import etree from lxml import etree
@@ -245,7 +246,10 @@ class UrlBot(IdleBot):
:returns: nothing :returns: nothing
""" """
data = msg_obj['body'] data = msg_obj['body']
words = data.split() try:
words = shlex.split(data)
except ValueError:
words = data.split()
# prepend the bot nick so we have the same syntax as in muc # prepend the bot nick so we have the same syntax as in muc
if msg_obj['type'] == 'chat' and words and self.nick not in words[0]: if msg_obj['type'] == 'chat' and words and self.nick not in words[0]: