commands - xnamed/isida4 GitHub Wiki

Table of Contents

Bot commands

The bot has a lot of commands and the list is constantly growing. The list of bot commands available with the current access level can be obtained with the command commands. Most commands have built-in help, which can be requested by the help <command, or part of the command description>, but there are complex commands whose operation principles are difficult to understand by a brief built-in description.

Action Lists: acl

This command provides the ability to customize actions for certain events in the conference, for example, to a fragment of a message or to a specific participant's resource.

  • acl show - Show action list
  • acl del [access_level] [/silent] item - Remove item from the list
  • acl [access_level] [/time] [/silent] event_type [sub|exp|cexp] pattern command - Execute the command by condition

Event type is one of the list: msg, prs, prs_change, prs_join, role, role_change, role_join, aff, aff_change, aff_join, nick, nick_change, nick_join, all, all_change, all_join, jid, jidfull, res, age, ver, vcard. Description of event types below.

With the slash, additional keys begin:

/time - Set the lifetime of the rule. At the end of this time, the rule will be automatically deleted at the next event, which is suitable for the rule type. In this case, "time" is the number + identifier. Where the identifier is one of the following:

  • s - seconds
  • m - minutes
  • d - days
  • w - weeks
  • M - months
  • y - years

For example: /10h - 10 hours or /1w - 1 week. You can only use one identifier!

/silent - If you successfully add or remove, do not display the full contents of the action, but simply answer ok . This key is made for creating aliases based on acl. in them it is enough simply to inform about successful execution.

access_level - The access level for which this rule will be executed.

Then follows the description of the type of event to which the reaction is needed:

  • msg - message
  • prs - any status message
  • prs_change - any status message, except the login message
  • prs_join - status message when logging in
  • role - any presence with the role of the participant (visitor, participant, moderator)
  • role_change - a role change or an ordinary presentation, except for the input presence
  • role_join - the role of the participant at the entrance to the conference
  • aff - any presence with affiliation of the participant (none, member, admin, owner)
  • aff_change - change of affiliation or usual presentation, except for presence when logging in
  • aff_join - affiliation of the participant at the entrance to the conference
  • nick - any presence with a nickname
  • nick_change - nickname change, except for nickname when logging in
  • nick_join - login nickname
  • jid - jid without resource
  • jidfull - jid with resource
  • res - resource
  • age - the time of the participant's stay in the conference
  • ver - client version
  • vcard - participant's vCard
  • all - any of the above events
  • all_change - any of the above events, except for logon events
  • all_join - any of the above events only when logging in

Next is a description of the type of sample:

  • sub substring
  • exp is a regular expression
  • cexp is a case-sensitive regular expression
  • = - strict match of the expression. In this case, the symbol '=' can not be specified
  • >, <, >=, <= - these conditions are only available for the age event

Next is any bot command with an access level of up to 7 inclusive. You can use variables inside the command:

  • ${NICK} - the nickname of the participant from which the event came
  • ${JID} - jid of the participant
  • ${SERVER} - the server on which the participant's jid is located
  • ${EXP} RegExp expression ${/EXP} - passing parameters cut by a regular expression

Examples

Reply to the phrase containing the word "hello":

acl msg sub Hello say ${NICK}: and you do not have to get sick!

To expel participants with the QIP resource:

acl res cexp ^ QIP $ kick ${NICK}
ptot break standards!

Show the participant's version, if it is in the conference less than a minute:

acl age <60 ver ${NICK}

Notify that the participant without authority (access level 3) hides the version:

acl 3 ver sub Error say $ {NICK} hides its version!

De-votes of participants without authority (access level 3) having an empty vCard:

acl 3 vcard empty visitor ${NICK}
Fill out the vCard and restart!

Notify that the participant without authority (access level 3) in the vCard has only the photo:

acl 3 vcard exp ^PHOTO:image/[a-z]{2,10},\ [.kmg0-9]+b$ say ${NICK} have only a photo in the vCard!

Important! If the conference has an acl event on the client version, as in the last example, then in the age database, the version information will be automatically recorded. The seen command will show the client version without specifying the system. The seenjid command will show the full version.

Useful links

  • Not a bad article on regular expressions.
  • Description of regular expressions on WIKI .
  • Online regular expression tester .

News: rss

The bot can show RSS/ATOM news in the conference on a schedule. The rss command format:

  • rss show - show current subscriptions.
  • rss add url time mode - add a subscription.
  • rss del url - delete the subscription.
  • rss get url feeds mode - get the current news.
  • rss new url feeds mode - get only unread news.
  • rss clear - delete all news in the current conference.
  • rss all - show all news in all conferences.

Where:

  • url - the rss channel address. can be set without http://
  • time - channel update time. number + pointer of time. h - hours, m - minutes. only one pointer is allowed.
  • feeds - the number of messages to receive. not more than 10 pcs.
  • mode - the mode of receiving messages. full - messages completely, head - only headers, body - only the body of the message. with the ending -url, url news will be shown.

Example

rss add bash.org.ru/rss 1h full-url

Settings: config

The bot has a lot of settings. Settings are divided into two groups - general settings and settings for a certain conference. General settings of the bot are available to its owner through a review of services, ad-hoc or remote control jid bot in the roster. The settings for the conference are available to participants with an access level of at least 7, also through the services overview, ad-hoc or remote control of the conference jid, or through the config command.

config [show[ status]|help][ item]

Examples

View settings list:

<xnamed> config show
<iSida> Elements are available: autoturn, bomb, bomb_action, bomb_action_level, bomb_fault, bomb_fault_persent,
	bomb_idle, bomb_random, bomb_random_active, bomb_random_active_timer, bomb_random_timer,
	bomb_random_timer_persent, bomb_random_timer_skip_persent, bomb_reason, bomb_timer, bomb_wire,
	censor, censor_action_member, censor_action_non_member, censor_custom, censor_custom_rules,
	censor_warning, clear_answer, flood, karma_action, karma_action_1ban, karma_action_2kick,
	karma_action_3visitor, karma_action_4none, karma_action_5participant, karma_action_6member,
	karma_action_7moderator, karma_action_reason, karma_hard, karma_limit, karma_limit_size,
	make_stanza_jid_count, muc_filter, muc_filter_adblock, muc_filter_adblock_prs, muc_filter_adblock_prs_raw,
	muc_filter_adblock_raw, muc_filter_blacklist, muc_filter_blacklist_rules_jid, muc_filter_blacklist_rules_nick,
	muc_filter_censor, muc_filter_censor_prs, muc_filter_censor_prs_raw, muc_filter_censor_raw,
	muc_filter_deny_hash, muc_filter_deny_hash_list, muc_filter_hash, muc_filter_hash_action,
	muc_filter_hash_action_current, muc_filter_hash_action_time, muc_filter_hash_ban_by_rejoin,
	muc_filter_hash_ban_by_rejoin_timeout, muc_filter_hash_ban_server_by_rejoin,
	muc_filter_hash_ban_server_by_rejoin_exception, muc_filter_hash_ban_server_by_rejoin_notify_jid,
	muc_filter_hash_ban_server_by_rejoin_rejoins, muc_filter_hash_ban_server_by_rejoin_timeout,
	muc_filter_hash_events, muc_filter_hash_time, muc_filter_large, muc_filter_large_nick,
	muc_filter_large_status, muc_filter_match, muc_filter_newbie, muc_filter_newbie_time, muc_filter_newline,
	muc_filter_newline_count, muc_filter_newline_msg, muc_filter_newline_msg_count, muc_filter_raw_percent,
	muc_filter_reduce_spaces_msg, muc_filter_reduce_spaces_prs, muc_filter_rejoin, muc_filter_repeat,
	muc_filter_repeat_prs, muc_filter_whitelist, parse_define, smiles, url_title

View item status:

<xnamed> config flood
<iSida> Flood: smart

View options for customizing the item:

<xnamed> config flood items
<iSida> Available elements: off, random, smart,

View the status of all settings:

<xnamed> config show status
<iSida> Current Status: 
[bomb] - Bomb. Allow the distribution of bombs: on
[bomb_action] - Bomb. Action in the explosion: drive out
...
[url_title] - Show link headers: off

Description of the config elements

The number of settings is constantly growing and may not coincide with the list below:

Muc filter settings

  • muc_filter - Muc switch common switch
  • muc_filter_adblock - Action on advertising in a message
  • muc_filter_adblock_prs - Action on advertising in status messages
  • muc_filter_censor - Actions of the censor on the mate in the message
  • muc_filter_censor_prs - Actions of the censor on the mate in the status message
  • muc_filter_large - Action on the big message
  • muc_filter_large_nick - Action on the big nickname
  • muc_filter_large_status - Action for a large status message
  • muc_filter_match - Action to repeat text inside a message
  • muc_filter_rejoin - Blocking multiple inputs
  • muc_filter_repeat - Action on repetitions of messages
  • muc_filter_repeat_prs - Action for frequent sending of statuses

More information about the muc-filter can be found here .

Settings for the bomb-joke

  • bomb - Allow the distribution of bombs in this conference
  • bomb_action - Action in the explosion of a bomb
  • bomb_fault - Allowing a percentage of bombs that do not explode
  • bomb_fault_persent - Percentage of non-working bombs
  • bomb_idle - The participant's silence time in seconds, after which he can not be given a bomb
  • bomb_random - Allow a random user to issue a bomb
  • bomb_random_active - Random bombs only in an active conference
  • bomb_random_active_timer - Time in seconds, during which the conference is considered active
  • bomb_random_timer - Time in seconds between random bombs
  • bomb_random_timer_persent - Time accuracy between random bombs in percent
  • bomb_random_timer_skip_persent - Percentage of non-random bomb installations
  • bomb_reason - The reason for the action in the explosion
  • bomb_timer - Bomb timer in seconds
  • bomb_wire - Number of wires at the bomb

Other settings

  • censor - General censor switch
  • censor_action_member - Censor action on permanent members
  • censor_action_non_member - Censor action on non-permanent members
  • censor_warning - Scolding admins per mate
  • clear_answer - Cleanup notifications about start and end as a message or status
  • flood - Activating an autoresponder
  • parse_define - Search for messages "what is an expression?" and display responses via google define
  • url_title - Show link headers
  • hard_karma - Hard binding to command syntax when changing karma

Abbreviations: alias

The alias command is intended to create alternative commands based on existing ones and, in combination with the acl command, represents a fairly good set for expanding the bot functionality.

Command format:

  • alias add aa = bb - execute the bb command when writing the command aa
  • alias del aa - remove abbreviation aa
  • alias show [text] - show all abbreviations or similar to text

Inside the abbreviation, you can pass parameters:

  • %* - pass all parameters as is
  • %N - transfer the parameter number N, numbering from zero
  • %{reduce}* - remove spaces at the beginning and end and pass the parameter
  • %{reduceall}* - remove spaces at the beginning, end, duplicate spaces within the text, and pass the parameter
  • %{unused}* - send unused parameters

You should also take into account that in the alias the executable command is specified without a prefix, as well as the shortened one is executed without a prefix.

Examples

Russian command on ping:

alias add пинг=ping %{reduce}*

The command of the automatic deprivation of the participant's voice:

alias add !avisitor=acl /%1 /silent jid %0 visitor ${NICK}
%{unused}*

Call the command:

!avisitor [email protected] 1h so it is necessary!

Useful alias

SMS price per short number:

alias add !smscost=www <div id='info'>.*<p>(.*)</p>
smscost.ru/number/%0

The latest update on the bot website:

alias add !latest=www <li>(.*)<li>
isida-bot.com

Search on lurke:

alias add !lurk=www <!-- start content -->.*<p>(.*)</p>
lurkmore.ru/index.php?search=%0

Show articles by number on Kill Me Please:

alias add !kmp=www <div class="fi_text">(.*)<div class="fi_vote">
http://killmepls.ru/story/%{reduce}*
⚠️ **GitHub.com Fallback** ⚠️