fix v43-v5 pseudo translation
This commit is contained in:
parent
bff132a7fd
commit
9fb5f92e72
21
shoutbox.py
21
shoutbox.py
|
@ -57,16 +57,17 @@ class Shoutbox(object):
|
|||
def post(self, user, msg, channel, users):
|
||||
if msg.startswith("ACTION"):
|
||||
msg = msg.replace("ACTION", "/me")
|
||||
if any(user in t for t in users):
|
||||
for i in users:
|
||||
if i[1] == user:
|
||||
r.post("https://www.planet-casio.com/Fr/shoutbox/api/post-as",
|
||||
data={"user": i[0], "message": msg, "channel": channel},
|
||||
cookies=self.cookies)
|
||||
else:
|
||||
r.post("https://www.planet-casio.com/Fr/shoutbox/api/post-as",
|
||||
data={"user": "IRC", "message": f"{user} : {msg}", "channel": channel},
|
||||
cookies=self.cookies)
|
||||
# Look for pseudo v43-v5 translation
|
||||
for v43_name, v5_name in users:
|
||||
if v5_name.lower() == user.lower():
|
||||
r.post("https://www.planet-casio.com/Fr/shoutbox/api/post-as",
|
||||
data={"user": v43_name, "message": msg, "channel": channel},
|
||||
cookies=self.cookies)
|
||||
return
|
||||
# No translation found
|
||||
r.post("https://www.planet-casio.com/Fr/shoutbox/api/post-as",
|
||||
data={"user": "IRC", "message": f"{user} : {msg}", "channel": channel},
|
||||
cookies=self.cookies)
|
||||
|
||||
def normalize(pseudo):
|
||||
if pseudo.lower() in [u[0].lower() for u in USERS]:
|
||||
|
|
Loading…
Reference in New Issue