more modules work

This commit is contained in:
2021-04-09 22:18:52 +02:00
parent 2ae965df4a
commit ed3a3c5595
4 changed files with 48 additions and 31 deletions

View File

@@ -23,7 +23,6 @@ steam_genre_regex = re.compile("Genre:</b>.*?<a.*?>(.+?)</a>")
# AMAZON
amazon_regex = re.compile("ama?zo?n\.(?:de|com)/.*(?:dp|gp/product)/([A-Z0-9]{10})(?:(?:/+)|$)?")
# TODO: Make regex more general (de|com)
# Commands
move_regex = re.compile("^moveall (.*)$")
@@ -121,8 +120,8 @@ class chatparser(MumoModule):
t = isodate.parse_duration(v["contentDetails"]["duration"])
try:
rate = "%.2f %%" % (
(((float(v["statistics"]["dislikeCount"]) / float(
v["statistics"]["likeCount"])) - 1.0) * -1.0) * 100.0)
(((float(v["statistics"]["dislikeCount"]) / float(
v["statistics"]["likeCount"])) - 1.0) * -1.0) * 100.0)
except ZeroDivisionError:
rate = "No rating possible"
self.sendMessage(server, user, message,