| |
- add_cmd(func, name=None)
- add_hook(func, command)
- Add a hook <func> for command <command>.
- applyModes(irc, target, changedmodes)
- Takes a list of parsed IRC modes, and applies them on the given target.
The target can be either a channel or a user; this is handled automatically.
- checkAuthenticated(irc, uid, allowAuthed=True, allowOper=True)
- Checks whetherthe given user has operator status on PyLink, raising
NotAuthenticatedError and logging the access denial if not.
- clientToServer(irc, numeric)
- Finds the SID of the server a user is on.
- getHostmask(irc, user)
- Gets the hostmask of the given user, if present.
- getProtoModule(protoname)
- Imports and returns the protocol module requested.
- isChannel(s)
- Checks whether the string given is a valid channel name.
- isHostmask(text)
- Returns whether the given text is a valid hostmask.
- isInternalClient(irc, numeric)
- Checks whether the given numeric is a PyLink Client,
returning the SID of the server it's on if so.
- isInternalServer(irc, sid)
- Returns whether the given SID is an internal PyLink server.
- isManipulatableClient(irc, uid)
- Returns whether the given user is marked as an internal, manipulatable
client. Usually, automatically spawned services clients should have this
set True to prevent interactions with opers (like mode changes) from
causing desyncs.
- isNick(s, nicklen=None)
- Checks whether the string given is a valid nick.
- isOper(irc, uid, allowAuthed=True, allowOper=True)
- Returns whether the given user has operator status on PyLink. This can be achieved
by either identifying to PyLink as admin (if allowAuthed is True),
or having user mode +o set (if allowOper is True). At least one of
allowAuthed or allowOper must be True for this to give any meaningful
results.
- isServerName(s)
- Checks whether the string given is a server name.
- joinModes(modes)
- Takes a list of (mode, arg) tuples in parseModes() format, and
joins them into a string.
See testJoinModes in tests/test_utils.py for some examples.
- loadModuleFromFolder(name, folder)
- Attempts an import of name from a specific folder, returning the resulting module.
- nickToUid(irc, nick)
- Returns the UID of a user named nick, if present.
- parseModes(irc, target, args)
- Parses a modestring list into a list of (mode, argument) tuples.
['+mitl-o', '3', 'person'] => [('+m', None), ('+i', None), ('+t', None), ('+l', '3'), ('-o', 'person')]
- reverseModes(irc, target, modes, oldobj=None)
- Reverses/Inverts the mode string or mode list given.
Optionally, an oldobj argument can be given to look at an earlier state of
a channel/user object, e.g. for checking the op status of a mode setter
before their modes are processed and added to the channel state.
This function allows both mode strings or mode lists. Example uses:
"+mi-lk test => "-mi+lk test"
"mi-k test => "-mi+k test"
[('+m', None), ('+r', None), ('+l', '3'), ('-o', 'person')
=> {('-m', None), ('-r', None), ('-l', None), ('+o', 'person')})
{('s', None), ('+o', 'whoever') => {('-s', None), ('-o', 'whoever')})
- toLower(irc, text)
- Returns a lowercase representation of text based on the IRC object's
casemapping (rfc1459 or ascii).
|