Compare commits
No commits in common. "b7b6ca71be1d410ded047171719c04cf27f2b143" and "cde8d8883d39f580543a14e793af054c87d9a66e" have entirely different histories.
b7b6ca71be
...
cde8d8883d
|
@ -114,8 +114,6 @@ 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: # The wikipedia package can raise a lot of different stuff.
|
except wikipedia.exceptions.WikipediaException:
|
||||||
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:
|
except wikipedia.exceptions.WikipediaException:
|
||||||
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,8 +35,10 @@ 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