Compare commits
3 commits
cde8d8883d
...
b7b6ca71be
Author | SHA1 | Date | |
---|---|---|---|
dece | b7b6ca71be | ||
dece | 5ca4a25b1f | ||
dece | 19e5408ba2 |
|
@ -114,6 +114,8 @@ class Bot(irc.client.SimpleIRCClient, Logger):
|
||||||
try:
|
try:
|
||||||
self.start()
|
self.start()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
self.log_i("Caught keyboard interrupt.")
|
||||||
|
finally:
|
||||||
self.log_i("Stopping Edmond.")
|
self.log_i("Stopping Edmond.")
|
||||||
self.__save_storage()
|
self.__save_storage()
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class WikipediaPlugin(Plugin):
|
||||||
try:
|
try:
|
||||||
summary = wikipedia.summary(wikipedia.random(), sentences=1)
|
summary = wikipedia.summary(wikipedia.random(), sentences=1)
|
||||||
break
|
break
|
||||||
except wikipedia.exceptions.WikipediaException:
|
except: # The wikipedia package can raise a lot of different stuff.
|
||||||
pass
|
pass
|
||||||
retries -= 1
|
retries -= 1
|
||||||
if summary:
|
if summary:
|
||||||
|
@ -59,7 +59,7 @@ class WikipediaPlugin(Plugin):
|
||||||
except wikipedia.exceptions.PageError:
|
except wikipedia.exceptions.PageError:
|
||||||
summary = self.config["empty_response"]
|
summary = self.config["empty_response"]
|
||||||
break
|
break
|
||||||
except wikipedia.exceptions.WikipediaException:
|
except:
|
||||||
summary = self.bot.config["error_message"]
|
summary = self.bot.config["error_message"]
|
||||||
# Keep trying after a slight delay.
|
# Keep trying after a slight delay.
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
|
@ -35,10 +35,8 @@ class YoutubeParserPlugin(Plugin):
|
||||||
def on_pubmsg(self, event):
|
def on_pubmsg(self, event):
|
||||||
words = event.arguments[0].split()
|
words = event.arguments[0].split()
|
||||||
for word in words:
|
for word in words:
|
||||||
self.bot.log_d("testing " + word)
|
|
||||||
match = self.VIDEO_URL_RE.match(word)
|
match = self.VIDEO_URL_RE.match(word)
|
||||||
if match:
|
if match:
|
||||||
self.bot.log_d("match!")
|
|
||||||
return self.handle_match(match, event.target)
|
return self.handle_match(match, event.target)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue