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!")
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!")
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!")
def update_on_ping(self, data, connection: Connection): # print('Module Ping') msg = 'PONG ' + data['server'] connection.raw_send(msg)