Skip to content

Default Commands Plugin

Innocent Bystander edited this page Aug 23, 2015 · 21 revisions

Requires plugin: default

All of these commands must be prefixed with /bot e.g. /bot <command>:

User Commands

echo [<conv_id>] <[raw:]string anything>

  • Bot replies with <string anything> as the message.
  • If <conv_id> is supplied, the bot will send the message to that conversation id - only admins are allowed to send messages to other conversations, regardless of any other access level settings.
  • Spaces are allowed for <string anything>. Special characters in <string anything> are auto-escaped by the bot unless it is prefixed with raw: - using this prefix allows the string to be interpreted in a posix-like way.
    • Related quirk: In bot version < 2.5, it is impossible to /bot echo "test (unbalanced double-quote at beginning) - this will raise an error. In bots > 2.5, it is possible to do this by using /bot echo raw:\"test - using the backslash to manually escape the double-quote, and the raw: prefix to switch off pre-2.5 emulation of auto-escaping special characters.

whoami

  • Bot replies with the current user information:
    • first name, nickname and chat_id, OR
    • full name and chat_id

Admin-only Commands

broadcast

  • Accepts sub-commands e.g. /bot broadcast info
    • info, shows message and target conversations
    • message <message text>, sets the message text to send
      • Note: Bot will not reply if the text is successfully set
    • add [groups|ALL|<text>]
      • groups adds all chats with more than 2 users
      • ALL adds all conversations the bot is participating in
        • IMPORTANT: This includes 1-to-1s, regardless of DNDs and opt-outs
      • any other <text> adds chats with partly-matching titles or exact chat id matches
    • remove [all|<text>]
      • all removes all conversations from the list
      • any other <text> removes chats with partly-matching titles or exact chat id matches
    • NOW sends the message to the target conversations - review the message and conversation list with /bot broadcast info first!
  • The message text and target conversations are not remembered through bot restarts.
  • For sync rooms, you must manually add all sync rooms individually to the target list, as implicit message relaying is disabled for a broadcast.

users

  • Bot lists all users in current conversation.
  • List will contain user G+ profile link and email (if available).

user <string name>

  • Bot searches for users whose names contain <string name> in internal user list.
  • Spaces allowed: abc x will match user names abc xyz or abcxyz, but not x abc
  • The bot will search all users in all participating conversations.

hangouts

  • Bot lists all participating conversations with additional details.
  • Legend: c = commands enabled; f = forwarding enabled; a = auto-replies.

hangout <string fragment>

  • Bot lists conversations matching fragment
  • List contains conversation names and ids

rename <string title>

  • Bot renames the current conversation.
  • Spaces in the title are allowed.
  • Works with both 1-on-1 or group conversations.
  • Note: 1-on-1 renames may not reflect their title properly on desktop clients.

leave [<conversation id>]

  • Bot leaves the current hangout if <conversation id> not specified.

quit

  • Kills the running bot process on the server with a disconnection.

config get <key> [<subkey> [...]]

  • Bot reads config.json and displays contents of config.<key>[.<subkey>...]

config set <key> [<subkey> [...]] <json>

  • Bot sets contents of config.<key>[.<subkey>...] to <json>
  • <json> must be strictly-valid JSON: {...}, [...], "...", true, false
  • Changes are saved instantly into config.json
  • WARNING: This command is low-level and can scramble the configuration

config append <key> [<subkey> [...]] <json>

  • Bot appends to list at config.<key>[.<subkey>...]
  • <json> must be strictly-valid JSON: {...}, [...], "...", true, false
  • Only works if the key pointed at is an actual list
  • Usually used to add administrator ids to config.admins
  • WARNING: This command is low-level and can scramble the configuration

config remove <key> [<subkey> [...]] <json>

  • Bot removes specified from list at config.<key>[.<subkey>...]
  • <json> must be strictly-valid JSON: {...}, [...], "...", true, false
  • Only works if the key pointed at is an actual list
  • Usually used to remove administrator ids from config.admins
  • WARNING: This command is low-level and can scramble the configuration

config test [<key> [<subkey> [...]]] <json>

  • Bot test the supplied parameters without changing the configuration
  • <json> must be strictly-valid JSON: {...}, [...], "...", true, false
  • If one parameter supplied, bot tests whether its valid JSON
  • If more than one parameter supplied, bot tests the last token as valid JSON
    • Bot will not test for <key> or <subkey> - this is simply a convenience function to test the JSON portion of copy-pasted command fragments

reload

  • reloads config.json and memory.json
  • useful only when files manually edited on running bot
  • use sparingly as a debugging tool, editing these files directly are not recommended

whereami

  • Bot replies with the conversation name and conversation id.

convid-family

[ ver < 2.7 ] part of default plugin, [ ver >= 2.7 ] in-built

Moved to CONVID Commands

# ## ###

Clone this wiki locally