Пример #1
0
    def update_conf(self, range_name):
        real_node = MCS.get_first_real_root(self.parent.url, range_name)[0]

        if MCS.node_depth(real_node) == 0:
            self.c.privmsg(self.argument[0].nick,
                           self.prefix + "Not working for now !")
        elif MCS.node_depth(real_node) == 1:
            self.parent.update_server_node()
            self.c.privmsg(self.argument[0].nick,
                           self.prefix + "Server updated !")
        elif MCS.node_depth(real_node) == 2:
            self.parent.channel_dict[range_name].update_server_node()
            self.c.privmsg(self.argument[0].nick,
                           self.prefix + "Channel updated !")
Пример #2
0
    def sender_relative_admin_power(self, range_name):
        root_path = MCS.get_node_root_path(range_name, self)
        sender_node = MCS.recursively_scan_node_info(root_path, "admin",
                                                     "mask", self.argument[0],
                                                     False)
        is_bot_admin = sender_node is not False and sender_node is not None

        if is_bot_admin:
            # remove 1 in depth because of the <admin> depth
            if MCS.range_depth(range_name) > MCS.node_depth(sender_node) - 1:
                return -1
            else:
                return int(sender_node.get("level"))
        else:
            return 5