fix %searchquote on unicode strings
This commit is contained in:
parent
4aa7092a0c
commit
431e0f2b48
1 changed files with 2 additions and 2 deletions
|
|
@ -309,14 +309,14 @@ class Boobot(SingleServerIRCBot):
|
||||||
|
|
||||||
def cmd_searchquote(self, nick, channel, text):
|
def cmd_searchquote(self, nick, channel, text):
|
||||||
try:
|
try:
|
||||||
pattern = re.compile(text, re.IGNORECASE)
|
pattern = re.compile(to_unicode(text), re.IGNORECASE|re.UNICODE)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.send_message(str(e), channel)
|
self.send_message(str(e), channel)
|
||||||
return
|
return
|
||||||
|
|
||||||
quotes = []
|
quotes = []
|
||||||
for quote in self.storage.get(channel, 'quotes', default=[]):
|
for quote in self.storage.get(channel, 'quotes', default=[]):
|
||||||
if pattern.search(quote['text']):
|
if pattern.search(to_unicode(quote['text'])):
|
||||||
quotes.append(quote)
|
quotes.append(quote)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue