def update_on_ping(self, data, connection: Connection):
     if self.active == 0:
         return
     if 1 == randint(1, 11):
         if self.duck_alive == 0:
             connection.send_channel("*. *. *. * <<w°)> *. *. * Quack!")
             self.duck_alive = 1
Exemple #2
0
 def update_on_priv_msg(self, data, connection: Connection):
     if data['message'].find('.guess ') != -1:
         self.guess(data, connection)
         return
     if data['message'].find('.word ') != -1:
         self.takeword(data, connection)
     if data['message'].find('.stop') != -1:
         self.word = ''
         self.guesses = []
         self.leftTrys = 0
         connection.send_channel("Spiel gestoppt")
Exemple #3
0
 def update_on_priv_msg(self, data, connection: Connection):
     if data['message'].find('.seen') == -1:
         return
     who = data['message'].split(' ')[1]
     user_provider = UserProvider()
     activity = user_provider.get_activity(who)
     delta = time.time() - activity
     i18n_server = i18n()
     replacements = {'user': who, 'time': str(datetime.timedelta(seconds=delta))}
     output = i18n_server.get_text('seen', replacements=replacements,
                                   lang=self.config.lang)
     connection.send_channel(output)
Exemple #4
0
 def update_on_priv_msg(self, data, connection: Connection):
     if data['message'].find('.seen') == -1:
         return
     who = data['message'].split(' ')[1]
     user_provider = UserProvider()
     activity = user_provider.get_activity(who)
     delta = time.time() - activity
     i18n_server = i18n()
     replacements = {'user': who, 'time': str(datetime.timedelta(seconds=delta)),'asker':data['nick']}
     output = i18n_server.get_text('seen', replacements=replacements,
                                   lang=self.config.lang)
     connection.send_channel(output)
Exemple #5
0
 def update_on_ping(self, data, connection: Connection):
     for user in self.user_list.userList:
         offline_time = Kicker.get_offline_time(user)
         if offline_time < 36000:
             self.warned_users[user] = 0
         # 36000s (= 1h) to test instead of 18000s (= 5h)
         if offline_time > self.idle_time and not user == connection.details.get_nick() and not user == "Sigyn":
             if self.warned_users[user] % 30 == 0:
                 connection.send_channel(
                     '\001ACTION schenkt ' + user + ' ' + random.choice(getraenke) + ' ein.\001')
             self.warned_users[user] += 1
             if self.warned_users[user] % 29 == 0:
                 connection.raw_send("KICK " + connection.details.get_channel() + " " + user +
                                     " :Zu lang geidlet, komm gerne wieder!")
Exemple #6
0
 def update_on_ping(self, data, connection: Connection):
     for user in self.user_list.userList:
         offline_time = Kicker.get_offline_time(user)
         if offline_time < 36000:
             self.warned_users[user] = 0
         # 36000s (= 1h) to test instead of 18000s (= 5h)
         if offline_time > self.idle_time and not user == connection.details.get_nick(
         ) and not user == "Sigyn":
             if self.warned_users[user] % 30 == 0:
                 connection.send_channel('\001ACTION schenkt ' + user +
                                         ' ' + random.choice(getraenke) +
                                         ' ein.\001')
             self.warned_users[user] += 1
             if self.warned_users[user] % 29 == 0:
                 connection.raw_send(
                     "KICK " + connection.details.get_channel() + " " +
                     user + " :Zu lang geidlet, komm gerne wieder!")
Exemple #7
0
 def update_on_ping(self, data, connection: Connection):
     for user in self.user_list.userList.keys():
         offline_time = Kicker.get_offline_time(user)
         if offline_time < self.idle_time:
             self.warned_users[user] = 0
         host = self.user_list.userList.get(user).host
         if offline_time > self.idle_time \
                 and not user == connection.details.get_nick() \
                 and 'freenode/staff' not in host:
             if self.warned_users[user] % 30 == 0:
                 connection.send_channel('\001ACTION schenkt ' + user +
                                         ' ' + random.choice(getraenke) +
                                         ' ein.\001')
             self.warned_users[user] += 1
             if self.warned_users[user] % 29 == 0:
                 connection.raw_send(
                     "KICK " + connection.details.get_channel() + " " +
                     user + " :Zu lang geidlet, komm gerne wieder!")
Exemple #8
0
 def update_on_priv_msg(self, data, connection: Connection):
     if data['message'].find('.guess ') != -1:
         self.guess(data, connection)
         return
     if data['message'].find('.word ') != -1:
         self.take_word(data, connection)
     if data['message'].find(
             '.stop') != -1 and not data['message'].find('.stophunt') != -1:
         connection.send_channel("Spiel gestoppt. Das Wort war: " +
                                 self.word)
         self.word = ''
         self.guesses = []
         self.tries_left = 0
         self.wrong_guessed = []
         self.worder = ''
     if data['message'].find('.hint') != -1:
         self.hint(data, connection)
     if data['message'].find('.score') != -1:
         self.print_score(data, connection)
     if data['message'].find('.spielregeln') != -1:
         self.rules(data, connection)
 def update_on_priv_msg(self, data, connection: Connection):
     if data['message'].find('.starthunt') != -1:
         if not self._is_idented_mod(data, connection):
             connection.send_back(
                 "Dir fehlen leider die Rechte zum Starten der Jagd, " +
                 data['nick'] + ".", data)
             return
         self.active = 1
         connection.send_channel("Jagd eröffnet")
         return
     if data['message'].find('.stophunt') != -1:
         if not self._is_idented_mod(data, connection):
             connection.send_back(
                 "Dir fehlen leider die Rechte zum Stoppen der Jagd, " +
                 data['nick'] + ".", data)
             return
         self.active = 0
         self.duck_alive = 0
         connection.send_channel("Jagd beended")
         return
     if data['message'].find('.freunde') != -1:
         self.befriend(data, connection)
     if data['message'].find('.schiessen') != -1:
         self.shoot(data, connection)