tormodbot module

tormodbot.CONNECTED_DELAY_SECS = 5

How long to wait, in seconds, before doing delayed on-connect actions

tormodbot.CONNECTED_TIMER_HOOK = None

Weechat timer hook on our event for delayed on-connect actions

tormodbot.MODULES = []

All modules, even those that are disabled

tormodbot.chanop_chans(chans, up)

Given a list of channels, ask chanserv to op us in each one (if up is True) otherwise deop ourself

tormodbot.chanserv_user()

Returns UserStr of the configured chanserv

tormodbot.cmd_chan()
tormodbot.code_url()
tormodbot.codedir()

Returns the directory in which this file resides

tormodbot.config_cb(data, option, value)

Called whenever the user changes some script options

tormodbot.connected_cb(data, signal, signal_data)

Callback for when we have (dis)connected to a server

tormodbot.datadir()

Returns tormodbot’s data directory

tormodbot.delayed_connect_cb()
tormodbot.handle_command(user, where, message)

UserStr user sent us str message that maybe should be treated as a command. The caller DID verified this user has permission to command us and that they sent us the message in a proper place. The caller does NOT verify that the message is a valid command. The str where indicates the place where we we got it: either ‘#channel’ if the cmd channel, or our own nick.

tormodbot.ignores()

Returns the list of nicks which we ignore all PRIVMSG and NOTICE. Nicks are normalized to lowercase.

tormodbot.infolist_len(ilist)

Takes an infolist that has a cursor already at the beginning. Count the number of items in it. Return cursor to beginning. Return number of items in infolist.

tormodbot.join_cb(data, signal, signal_data)

Callback for when we see a JOIN

tormodbot.log(s, *a, **kw)
tormodbot.log_chan()

Return the currently configured logging channel, or None if not configured. Chan is normalized to lowercase

tormodbot.masters()

Returns the list of my currently configured masters. Nicks are normalized to lowercase

tormodbot.mod_chans()

Returns the list of my currently configured channels to moderate. Chans are normalized to lowercase.

tormodbot.my_nick()

Returns my current nick on the configured server

tormodbot.nickserv_user()

Returns UserStr of the configured nickserv

tormodbot.notice_cb(data, signal, signal_data)

Callback for when we see a NOTICE

tormodbot.part_cb(data, signal, signal_data)

Callback for when we see a PART

tormodbot.privmsg_cb(data, signal, signal_data)

Callback for when we see a PRIVMSG

tormodbot.serv()

Returns the configured server

tormodbot.timer_cb(data, remaining_calls)

Whenever a timer expires, this function should be called. If data is set, then it was that module that set a timer that expired, so we should hand control off to it. Otherwise it was us.

tormodbot.transform_bang_shortcuts(msg)

Take a message. If it looks like a bang shortcut (e.g. !paste),, then convert it to the long form message that will actually cause us to do what we intend.