示例#1
0
    def help(self):
        # For pre 1.7.* znc use the below line for prettier output
        # help = znc.CTable(250)
        help = znc.CTable()
        help.AddColumn("Command")
        help.AddColumn("Arguments")
        help.AddColumn("Description")
        help.AddRow()
        help.SetCell("Command", "check")
        help.SetCell("Arguments", "<user> <#channel> [modes]")
        help.SetCell(
            "Description",
            "Checks to see if an online user is banned in a channel, optionally set modes (default: bq)"
        )
        help.AddRow()
        help.SetCell("Command", "set")
        help.SetCell("Arguments", "<key> <value>")
        help.SetCell(
            "Description",
            "Sets settings, for available settings and their values see \"settings\""
        )
        help.AddRow()
        help.SetCell("Command", "settings")
        help.SetCell("Arguments", "")
        help.SetCell("Description", "Displays settings and their value")
        help.AddRow()
        help.SetCell("Command", "help")
        help.SetCell("Arguments", "")
        help.SetCell("Description", "Display this output")

        self.PutModule(help)
示例#2
0
 def showSettings(self):
     settings = znc.CTable()
     settings.AddColumn("Setting")
     settings.AddColumn("Value")
     settings.AddColumn("Description")
     settings.AddRow()
     settings.SetCell("Setting", "showSetter")
     settings.SetCell("Value", str(self.showSetter))
     settings.SetCell(
         "Description",
         "Show who did set that mode, values are True or False.")
     settings.AddRow()
     settings.SetCell("Setting", "showTimeAgo")
     settings.SetCell("Value", str(self.showTimeAgo))
     settings.SetCell(
         "Description",
         "Show how long since the mode has been set, values are True or False."
     )
     settings.AddRow()
     settings.SetCell("Setting", "showTimestamp")
     settings.SetCell("Value", str(self.showTimeStamp))
     settings.SetCell(
         "Description",
         "Show the time and date at which the mode was set, values are True or False."
     )
     settings.AddRow()
     settings.SetCell("Setting", "TimestampFormat")
     settings.SetCell("Value", str(self.timeStampFormat))
     settings.SetCell(
         "Description",
         "Format for the timestamp of \"showtimestamp\", values are valid strftime formattings."
     )
     self.PutModule(settings)
示例#3
0
 def send_help(self, line):
     help_tbl = znc.CTable()
     help_tbl.AddColumn("Command")
     help_tbl.AddColumn("Arguments")
     help_tbl.AddColumn("Description")
     for command in self.commands.values():
         help_tbl.AddRow()
         help_tbl.SetCell("Command", command.name)
         help_tbl.SetCell("Arguments", command.syntax)
         help_tbl.SetCell("Description", command.doc)
     self.PutModule(help_tbl)
示例#4
0
    def cmd_help(self):
        """Returns help documentation for this module"""
        help_table = znc.CTable()
        help_table.AddColumn("Command")
        help_table.AddColumn("Arguments")
        help_table.AddColumn("Description")

        for cmd in sorted(self.cmd_handlers.values(), key=attrgetter("name")):
            help_table.AddRow()
            help_table.SetCell("Command", cmd.name)
            help_table.SetCell("Arguments", cmd.syntax or "")
            help_table.SetCell("Description", cmd.help_msg or "")

        return help_table, "You can also view this help at {}".format(help_url)
示例#5
0
    def show_help(self):
        self.PutModule("{0.__class__.__name__}: {0.description}\n".format(self))
        for h in self.HELP:
            self.PutModule(h)
        self.PutModule("\nCommands:")
        tbl = znc.CTable()
        tbl.AddColumn("Command")
        tbl.AddColumn("Description")
        for k, v in self.CMDS:
            tbl.AddRow()
            tbl.SetCell("Command", k)
            tbl.SetCell("Description", v)
        self.PutModule(tbl)

        self.PutModule("\nExamples:")
        tbl = znc.CTable()
        tbl.AddColumn("Command")
        tbl.AddColumn("Result")
        for k, v in self.EXAMPLES:
            tbl.AddRow()
            tbl.SetCell("Command", k)
            tbl.SetCell("Result", v)
        self.PutModule(tbl)
示例#6
0
 def list_rules(self, line):
     if not self.sno_settings:
         self.PutModule("No rules configured for server notices")
         return
     rule_tbl = znc.CTable()
     rule_tbl.AddColumn("Num")
     rule_tbl.AddColumn("Type")
     rule_tbl.AddColumn("Window")
     rule_tbl.AddColumn("Message Type")
     for i, settings in enumerate(self.sno_settings):
         rule_tbl.AddRow()
         rule_tbl.SetCell("Num", str(i))
         rule_tbl.SetCell("Type", settings['type'])
         rule_tbl.SetCell("Window", settings.get('window', 'None'))
         rule_tbl.SetCell("Message Type", settings.get('msg_type', ''))
     self.PutModule(rule_tbl)
示例#7
0
    def help(self):
        help = znc.CTable(250)
        help.AddColumn("Command")
        help.AddColumn("Arguments")
        help.AddColumn("Description")
        help.AddRow()
        help.SetCell("Command", "set")
        help.SetCell("Arguments", "<setting> <variable>")
        help.SetCell(
            "Description",
            "Set the configuration options. See README for more information.")
        help.AddRow()
        help.SetCell("Command", "settings")
        help.SetCell("Arguments", "")
        help.SetCell("Description", "Display your current settings.")
        help.AddRow()
        help.SetCell("Command", "about")
        help.SetCell("Description", "Display information about this module")
        help.AddRow()
        help.SetCell("Command", "help")
        help.SetCell("Arguments", "")
        help.SetCell("Description", "Display this table.")

        self.PutModule(help)
示例#8
0
 def help_cmd(self):
     help_table = znc.CTable()
     help_table.AddColumn("Command")
     help_table.AddColumn("Arguments")
     help_table.AddColumn("Description")
     help_table.AddRow()
     help_table.SetCell("Command", "addchan")
     help_table.SetCell("Arguments", "Channel Name")
     help_table.SetCell("Description", "Adds a channel to the enforced "
                        "channel list")
     help_table.AddRow()
     help_table.SetCell("Command", "delchan")
     help_table.SetCell("Arguments", "Channel Name")
     help_table.SetCell(
         "Description", "Removes a channel from the "
         "enforced channel list")
     help_table.AddRow()
     help_table.SetCell("Command", "lchan")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell(
         "Description", "Lists all channels in the enforced"
         " channel list")
     help_table.AddRow()
     help_table.SetCell("Command", "clchan")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell("Description", "Clears the enforced channel list")
     help_table.AddRow()
     help_table.SetCell("Command", "setcount")
     help_table.SetCell("Arguments", "Number")
     help_table.SetCell(
         "Description", "Sets the number of highlights that "
         "triggers action, by default, this "
         "is 10")
     help_table.AddRow()
     help_table.SetCell("Command", "getcount")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell(
         "Description", "gets the current number of "
         "highlights required to trigger "
         "action")
     help_table.AddRow()
     help_table.SetCell("Command", "addexempt")
     help_table.SetCell("Arguments", "{}".format(" ".join(self.vexempts)))
     help_table.SetCell(
         "Description", "Adds to the list of exempted modes,"
         " if you have the set mode and "
         "mass highlight, it will be logged "
         "but no action will take place")
     help_table.AddRow()
     help_table.SetCell("Command", "delexempt")
     help_table.SetCell("Arguments", "{}".format(" ".join(self.vexempts)))
     help_table.SetCell("Description", "Removes an exempt from the list")
     help_table.AddRow()
     help_table.SetCell("Command", "lexempt")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell("Description", "Lists the current exempt list")
     help_table.AddRow()
     help_table.SetCell("Command", "clexempt")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell(
         "Description", "Clears the exempt list, the default"
         " is op hop voice")
     help_table.AddRow()
     help_table.SetCell("Command", "addmexempt")
     help_table.SetCell("Arguments", "mask")
     help_table.SetCell(
         "Description", "Adds a mask that is exempt from "
         "action, in the format "
         "nick!user@host, wildcards are "
         "accepted")
     help_table.AddRow()
     help_table.SetCell("Command", "delmexempt")
     help_table.SetCell("Arguments", "mask")
     help_table.SetCell("Description", "Removes a mask from the mask "
                        "exempt list")
     help_table.AddRow()
     help_table.SetCell("Command", "lmexempt")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell("Description", "Lists the current mask exempts")
     help_table.AddRow()
     help_table.SetCell("Command", "clmexempt")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell("Description", "Clears the mask exempt list")
     help_table.AddRow()
     help_table.SetCell("Command", "reset")
     help_table.SetCell("arguments", "None")
     help_table.SetCell("Description",
                        "Resets everything to default values")
     help_table.AddRow()
     help_table.SetCell("Command", "addcmd")
     help_table.SetCell("Arguments", "raw line")
     help_table.SetCell(
         "Description", "Adds a raw line to be sent when the"
         " script is triggered. you can use "
         "{nick} for the nickname, {chan} for"
         " the channel that triggered"
         "a response, and {mask} for the "
         "nick's mask in the format *!*@host")
     help_table.AddRow()
     help_table.SetCell("Command", "delcmd")
     help_table.SetCell("Arguments", "raw line")
     help_table.SetCell("Description", "Removes a line from the command "
                        "list")
     help_table.AddRow()
     help_table.SetCell("Command", "lcmd")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell(
         "Description", "Lists all the current commands sent"
         " when the script is triggered")
     help_table.AddRow()
     help_table.SetCell("Command", "clcmd")
     help_table.SetCell("Arguments", "None")
     help_table.SetCell("Description", "Clears the command list")
     help_table.AddRow()
     help_table.SetCell("Command", "timeout")
     help_table.SetCell("Arguments", "number or nothing")
     help_table.SetCell(
         "Description", "If not given an argument, returns "
         "the current multi line timeout, "
         "that is,the amount of time before "
         "someone is cleared from the list "
         "of pings")
     self.PutModule(help_table)
示例#9
0
    def cmd_help(self):
        help = znc.CTable(250)
        help.AddColumn("Command")
        help.AddColumn("Arguments")
        help.AddColumn("Description")
        help.AddRow()
        help.SetCell("Command", "all")
        help.SetCell("Arguments", "<user>")
        help.SetCell("Description",
                     "Get all information on a user (nick, ident, or host)")
        help.AddRow()
        help.SetCell("Command", "history")
        help.SetCell("Arguments", "<user>")
        help.SetCell("Description", "Show history for a user")
        help.AddRow()
        help.SetCell("Command", "users")
        help.SetCell("Arguments",
                     "<#channel 1> [<#channel 2>] ... [<channel #>]")
        help.SetCell("Description",
                     "Show common users between a list of channel(s)")
        help.AddRow()
        help.SetCell("Command", "channels")
        help.SetCell("Arguments", "<user 1> [<user 2>] ... [<user #>]")
        help.SetCell(
            "Description",
            "Show common channels between a list of user(s) (nicks, idents, or hosts, including mixed)"
        )
        help.AddRow()
        help.SetCell("Command", "seen")
        help.SetCell("Arguments", "<user> [<#channel>]")
        help.SetCell("Description", "Display last time user was seen speaking")
        help.AddRow()
        help.SetCell("Command", "geo")
        help.SetCell("Arguments", "<user>")
        help.SetCell("Description",
                     "Geolocates user (nick, ident, host, IP, or domain)")
        help.AddRow()
        help.SetCell("Command", "who")
        help.SetCell("Arguments", "<scope>")
        help.SetCell(
            "Description",
            "Update userdata on all users in the scope (#channel, network, or all)"
        )
        help.AddRow()
        help.SetCell("Command", "process")
        help.SetCell("Arguments", "<scope>")
        help.SetCell(
            "Description",
            "Add all current users in the scope (#channel, network, or all) to the database"
        )
        help.AddRow()
        help.SetCell("Command", "rawquery")
        help.SetCell("Arguments", "<query>")
        help.SetCell("Description", "Run raw sqlite3 query and return results")
        help.AddRow()
        help.SetCell("Command", "about")
        help.SetCell("Description", "Display information about aka")
        help.AddRow()
        help.SetCell("Command", "stats")
        help.SetCell("Description", "Print data stats for the current network")
        help.AddRow()
        help.SetCell("Command", "help")
        help.SetCell("Description", "Print help for using the module")
        help.AddRow()
        help.SetCell("Command", "NOTE")
        help.SetCell("Arguments", "Wildcard Searches")
        help.SetCell(
            "Description",
            "<user> supports * and ? GLOB wildcard syntax (combinable at start, middle, and end)."
        )

        self.PutModule(help)