Example #1
0
 def send_global_message(self, ship, user, message, server=None):
     if not check_pso2_with_irc(message):
         return
     if server is None:
         self.msg(self.factory.channel, "[G-%02i] <%s> %s" % (ship, user, replace_pso2_with_irc(message)))
     else:
         self.msg(self.factory.channel, "(%s) [G-%02i] <%s> %s" % (server, ship, user, replace_pso2_with_irc(message)))
Example #2
0
 def send_global_message(self, ship, user, message, server=None):
     if not check_pso2_with_irc(message):
         return
     fb = ("G-%02i") % ship
     shipl = ShipLabel.get(fb, fb)
     if server is None:
         self.msg(self.factory.channel, "[%s] <%s> %s" % (shipl, user, replace_pso2_with_irc(message)))
     else:
         self.msg(self.factory.channel, "(%s) [%s] <%s> %s" % (server, shipl, user, replace_pso2_with_irc(message)))
Example #3
0
 def send_global_message(self, ship, user, message, server=None):
     if not check_pso2_with_irc(message):
         return
     fb = ("G-%02i") % ship
     shipl = ShipLabel.get(fb, fb)
     if server is None:
         self.msg(self.factory.channel, "[%s] <%s> %s" % (shipl, user, replace_pso2_with_irc(message)))
     else:
         self.msg(self.factory.channel, "(%s) [%s] <%s> %s" % (server, shipl, user, replace_pso2_with_irc(message)))
Example #4
0
 def send_global_message(self, ship, user, message, server=None):
     if not check_pso2_with_irc(message):
         return
     if server is None:
         self.msg(
             self.factory.channel, "[G-%02i] <%s> %s" %
             (ship, user, replace_pso2_with_irc(message)))
     else:
         self.msg(
             self.factory.channel, "(%s) [G-%02i] <%s> %s" %
             (server, ship, user, replace_pso2_with_irc(message)))
Example #5
0
 def send_global_message(self, ship, user, message, server=None):
     if not check_pso2_with_irc(message):
         return
     fb = ("G-%02i") % ship
     shipl = ShipLabel.get(fb, fb)
     if server is None and redisEnabled:
         server = PSO2PDConnector.connector_conf['server_name']
     if discord:
         if server is None:
             self.say(self.factory.channel, "`[%s] %s`: %s" % (shipl, user, replace_pso2_with_irc(message)), 250)
         else:
             self.msg(self.factory.channel, "`(%s) [%s] %s`: %s" % (server, shipl, user, replace_pso2_with_irc(message)))
     else:
         if server is None:
             self.msg(self.factory.channel, "[%s] <%s> %s" % (shipl, user, replace_pso2_with_irc(message)))
         else:
             self.msg(self.factory.channel, "(%s) [%s] <%s> %s" % (server, shipl, user, replace_pso2_with_irc(message)))
Example #6
0
def translate_message(cmd, message, end_lang, start_lang):
    try:
        if provider == "Bing" and time.time() - lastKeyTime >= 600:
            translator.access_token = translator.get_access_token()

        if "}" in message:
            translate_msg = translator.translate(check_pso2_with_irc(message), end_lang, start_lang)
        else:
            translate_msg = translator.translate(message, end_lang, start_lang)

        if end_lang == "ja":
            message_string = "%s%s" % (cmd, translate_msg)
        else:
            message_string = "%s%s {def}(%s{def})" % (cmd, translate_msg, message)
    except Exception as e:
        print (str(e))
        message_string = message

    return message_string
Example #7
0
 def send_global_message(self, ship, user, message, server=None):
     if not check_pso2_with_irc(message):
         return
     fb = ("SHIP-%02i") % ship
     shipl = ShipLabel.get(fb, fb)