``core`` commands ================= .. csv-table:: :widths: auto "**Plugin**", :class:`~shellbot.plugins.core.Core` "**Brief**", "Core commands." `cat <../plugins/core.html#shellbot.plugins.core.Core.cat>`_ ------------------------------------------------------------ .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Read specific data." "**Usage**", ``cat target`` .. code-block:: text positional arguments: target data to read Examples ~~~~~~~~ .. csv-table:: :widths: auto "``cat``","list available data" "``cat plugins``","display server plugins" "``cat commands``","display server commands" `chmod <../plugins/core.html#shellbot.plugins.core.Core.chmod>`_ ---------------------------------------------------------------- .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Manage commands blacklist and server plugins." "**Usage**", ``chmod [+x PX] [-x NX]`` .. code-block:: text optional arguments: +x PX enable TARGET -x NX disable TARGET Examples ~~~~~~~~ .. csv-table:: :widths: auto "``chmod``","List server and channel blacklist." "``chmod +x ~/``","Enable all disabled commands (channel-wide)." "``chmod +x ~/*``","Enable all disabled commands (server-wide)." "``chmod +x /``","Enable all disabled plugins (channel-wide)." "``chmod +x /*``","Enable all disabled plugins (server-wide)." "``chmod +x whois``","Enable 'whois' command (channel-wide)." "``chmod +x whois -x ah``","Enable 'whois' command and disable 'ah' command (channel-wide)." "``chmod +x whois*``","Enable 'whois' command (server-wide)." "``chmod +x sysadmin/``","Enable plugin (channel-wide)." "``chmod +x sysadmin/*``","Enable plugin (server-wide)." Details ~~~~~~~ When the parser encounters the suffix string ``/`` in `TARGET` (e.g. `nsfw/`), `TARGET` is interpreted as a plugin name instead of a comand name. The changes are applied to the current channel by default and are extended to server scope via the suffix ``*`` (e.g. `ah*` [command] or `nsfw/*` [plugin]). The literal string ``/`` (resp. ``/*``) describes all commands (resp. plugins) for the server and can be used as a complete `TARGET` string. The equivalent channel scope form is given by ``~/`` (resp. ``~/*``). .. code-block:: bash $ chmod +x ~/ # Enable all the disabled commands on the channel $ chmod +x ~/* # Enable all the disabled plugins on the channel $ chmod +x / # Enable all the disabled commands on the server $ chmod +x /* # Enable all the disabled plugins on the server $ chmod -x / # Disable all the enabled commands on the server $ chmod -x /* # Disable all the enabled plugins on the server Essentials or sysadmin-disabled commands or plugins cannot be changed and the changes are applied only if no error occurs. To disable all commands or plugins on the server, use the **shutdown** command (to be implemented). `config <../plugins/core.html#shellbot.plugins.core.Core.config>`_ ------------------------------------------------------------------ .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Bot server configuration interface." "**Usage**", ``config [+V | -V] [+at | -at] [--prefix PREFIX] [-v] [-r] [-D]`` .. code-block:: text optional arguments: +V set logout voice policy to 'automatic' -V set logout voice policy to 'manual' +at set mentions for interaction to 'required' -at set mentions for interaction to 'optional' -p, --prefix PREFIX change server command prefix --verbose, -v change logging policy --reset, -r reset the server configuration (keep server roles) --default, -D show the default configuration Examples ~~~~~~~~ .. csv-table:: :widths: auto "``config``","Show current server configuration." "``config --prefix ?``","Set command prefix to '?'." "``config -v``","Change logging policy to DEFAULT_LOGS." "``config -vv``","Change logging policy to MODS_LOGS." "``config -vvv``","Change logging policy to STATUS_LOGS." "``config -vvvv``","Change logging policy to MANAGE_LOGS." Details ~~~~~~~ A prefix has to be a bytes-sequence between <1> and <3> characters with no spaces and distinct from 'su.' (reserved). Logging levels inherit lower levels, i.e. loggers of level ``L > L'`` also log what loggers of level ``L'`` may log. +------------------+-----------------------------------------------+ | Level | Description | +==================+===============================================+ | ``DEFAULT_LOGS`` | No logs are done. | +------------------+-----------------------------------------------+ | ``MODS_LOGS`` | Logs the kick/ban/mute actions | +------------------+-----------------------------------------------+ | ``STATUS_LOGS`` | Logs the login/logout and join/leave actions | +------------------+-----------------------------------------------+ | ``MANAGE_LOGS`` | Logs the create/delete channel actions | +------------------+-----------------------------------------------+ `config-export <../plugins/core.html#shellbot.plugins.core.Core.config_export>`_ -------------------------------------------------------------------------------- .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Copy and store server configuration for future usage." "**Usage**", ``config-export [--roles] [--inspect] [--delete]`` .. code-block:: text optional arguments: --roles export server custom roles (ShellBot) --inspect inspect exported configuration --delete delete exported configuration Details ~~~~~~~ The ** config-export ** command exports the bot configuration for the server where it is executed. By default, custom roles (in the sense of a role with a GID parent) are not exported. Exported configuration is consumed after approximatively one hour, accordingly to Privacy Terms (see LEGAL terms). `config-import <../plugins/core.html#shellbot.plugins.core.Core.config_import>`_ -------------------------------------------------------------------------------- .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Import an exported configuration." "**Usage**", ``config-import [--keep]`` .. code-block:: text optional arguments: --keep import server configuration and keep it for further usage Details ~~~~~~~ The ** config-import ** command allows users to import the ShellBot server configuration from a server A to a server B and must own both servers. Discord server configuration itself is not modified. Importing configuration delete exported configuration. To keep it for further usage (e.g. import to server C), use the '--keep' parameter. `debug <../plugins/core.html#shellbot.plugins.core.Core.debug_command>`_ ------------------------------------------------------------------------ .. csv-table:: :widths: auto "**Aliases**", "gdb" "**Brief**", "Attempt to debug a locked state. All operations are cancelled and interaction is disabled during the debugging process." "**Usage**", ``debug`` `htop <../plugins/core.html#shellbot.plugins.core.Core.htop>`_ -------------------------------------------------------------- .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Show global statistics." "**Usage**", ``htop`` `ignoreme <../plugins/core.html#shellbot.plugins.core.Core.ignoreme>`_ ---------------------------------------------------------------------- .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Add invoker to ShellBot global ignore list. Invoker remove themself from ignore list by sending a private message to the bot." "**Usage**", ``ignoreme`` `log <../plugins/core.html#shellbot.plugins.core.Core.log>`_ ------------------------------------------------------------ .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Manage server logs (ShellBot logs only)." "**Usage**", ``log [--stderr STDERR | -d DATES] [--reset] [--clear] [--today]`` .. code-block:: text optional arguments: -s, --stderr STDERR a channel mention for a standard error (stderr) channel --dates, -d DATES request logs for a given date or period --reset unset stderr channel --clear clear all compressed and daily logs --today inspect current logs Examples ~~~~~~~~ .. csv-table:: :widths: auto "``log``","Display current log in stderr channel." "``log -d 12-10-2016``","Recover logs for the given date." "``log -d 12-10-2016 12-10-2017``","Recover logs for the given period." `ragequit <../plugins/core.html#shellbot.plugins.core.Core.ragequit>`_ ---------------------------------------------------------------------- .. csv-table:: :widths: auto "**Aliases**", "fckoff" "**Brief**", "Remove the bot from the server. Owners only." "**Usage**", ``ragequit`` `sleep <../plugins/core.html#shellbot.plugins.core.Core.sleep>`_ ---------------------------------------------------------------- .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Shutdown bot for the server." "**Usage**", ``sleep [--cancel] [time] [delay] [dt]`` .. code-block:: text positional arguments: time time to execute the procedure at delay shutdown time delay string (syntax +x[d|h|m|s]) dt shutdown time duration string (syntax =x[d|h|m|s]) optional arguments: -c, --cancel cancel the shutdown procedure Examples ~~~~~~~~ .. csv-table:: :widths: auto "``sleep``","Show current shutdown procedure." "``sleep now``","Shutdown for 1 hour." "``sleep 08:00 +d``","Postpone shutdown at '08:00' in 1 day from now." "``sleep 08:00 +2d``","Postpone shutdown at '08:00' in 2 days from now." "``sleep 08:00 +d =30m``","Postpone a shutdown between '08:00' and '08:00' in 1 day from now." "``sleep 08:00 +2d =30m``","Postpone a shutdown between '08:00' and '08:30' in 2 days from now." Details ~~~~~~~ time A time string in the format hh:mm:ss for hour, minutes or seconds specifying the time to execute the shutdown at, and in 24h clock format. delay A string starting with + and followed by an integer referring to the delay time value from now and a time format `FMT`. dt A string starting with = and followed by an integer referring to the duration of the shutdown procdure and a time format `FMT`. `test <../plugins/core.html#shellbot.plugins.core.Core.test>`_ -------------------------------------------------------------- .. csv-table:: :widths: auto "**Aliases**", "No alias" "**Brief**", "Test command" "**Usage**", ``test``