3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00
PyLink/docs/automode.md
2017-05-04 18:00:32 -07:00

3.7 KiB
Raw Blame History

Automode & Exttargets Guide

The Automode plugin was introduced in PyLink 0.9 as a simple way of managing channel access control lists with Relay. That said, it is not designed to entirely replace traditional IRC services such as ChanServ.

Starting steps

Upon loading the automode plugin, you should see an Automode service bot connect, using the name that you defined. This bot provides the commands used to manage access.

For a list of commands: - /msg ModeBot help

Adding access lists to a channel: - /msg ModeBot setacc #channel [MASK] [MODE LIST] - The mask can be a simple nick!user@host hostmask or any of the extended targets (exttargets) mentioned below. MODE LIST is a string of any prefix modes that you want to set (no + before needed), such as qo, h, or ov.

Removing access from a channel: - /msg ModeBot delacc #channel [MASK]

Listing access entries on a channel: - /msg ModeBot listacc #channel

Applying all access entries on a channel (sync): - /msg ModeBot syncacc #channel

Clearing all access entries on a channel: - /msg ModeBot clearacc #channel

Supported masks and extended targets

Extended targets or exttargets replace regular hostmasks with conditional matching based on the given situation. The following exttargets are supported:

  • $account -> Returns True (a match) if the target is registered.
  • $account:accountname -> Returns True if the targets account name matches the one given, and the target is connected to the local network. Account names are case insensitive.
  • $account:accountname:netname -> Returns True if both the targets account name and origin network name match the ones given. Account names are case insensitive, but network names ARE case sensitive.
  • $account:*:netname -> Matches all logged in users on the given network. Globs are not supported here; only a literal *.
  • $ircop -> Returns True (a match) if the target is opered.
  • $ircop:*admin* -> Returns True if the targets is opered and their oper type matches the glob given (case insensitive).
  • $server:server.name -> Returns True (a match) if the target is connected on the given server. Server names are matched case insensitively.
  • $server:*server.glob* -> Returns True (a match) if the target is connected on a server matching the glob.
  • $server:1XY -> Returns True if the targets is connected on the server with the given SID. Note: SIDs ARE case sensitive.
  • $channel:#channel -> Returns True if the target is in the given channel (case insensitive).
  • $channel:#channel:op -> Returns True if the target is in the given channel, and is opped. Any supported prefix mode (owner, admin, op, halfop, voice) can be used for the last part, but only one at a time.
  • $pylinkacc -> Returns True if the target is logged in to PyLink.
  • $pylinkacc:accountname -> Returns True if the targets PyLink login matches the one given (case insensitive).
  • $network:netname -> Returns True if the target user originates from the given network (this supports and looks up the home network of Relay users).

The “and" target The `and` target is slightly more complex. Examples:

  • $and:($ircop:*admin*+$network:ovd) -> Matches all opers on the network ovd.
  • $and:($account+$pylinkirc) -> Matches all users logged in to both services and PyLink.
  • $and:(*!*@localhost+$ircop) -> Matches all opers with the host localhost.
  • $and:(*!*@*.mibbit.com+!$ircop+!$account) -> Matches all mibbit users that arent opered or logged in to services.

Permissions

See the Permissions Reference for a list of permissions defined by Automode.

Caveats