Skip to content
nemunaire edited this page Sep 8, 2014 · 5 revisions

When you launch nemubot, you are in a simple shell in which you can type command. For the time, commands are limited to built-ins, but in the future, it will be possible to use modules to extend shell features.

Built-ins

quit or exit

Save and shutdown all modules, disconnect all servers and quit.

reset

Save and shutdown all modules, reload the prompt and most of the code.

This doesn't reload Server code, use hotswap command for doing this after a reset.

refresh

Reload the prompt and most of the code.

This command doesn't reload modules or server code.

load

Try to load a configuration file or a module.

Give to this command a relative path from the current directory to an XML file only. To load a module, just type its name, or relative path from the current directory to its XML configuration file.

Example:

nemubot§ load hello #Load the module hello
nemubot§ load modules/hello.xml #Similar to previous command, in a basic environnement
nemubot§ load bot.xml #Load servers from this file

hotswap

Refresh the code of the given Server class without breaking the connection to the IRC server.

Example:

nemubot§ hotswap irc.freenode.org:6667
irc.freenode.org:6667§ hotswap

close

Disconnect and remove a server from the list.

Example:

nemubot§ close irc.freenode.org:6667
irc.freenode.org:6667§ close

unload

Unload a module and remove it from the list.

Example:

nemubot§ unload hello

select

Select a server to avoid having to specify its name for each command.

Example:

nemubot§ select irc.freenode.org:6667
irc.freenode.org:6667§ select
nemubot§

list

Display informations about servers, modules, ...

Example:

nemubot§ list
  Please give a list to show: servers, modules, ...
nemubot§ list servers
  - irc.freenode.org:6667 ;
  - irc.quakenet.org:6667 ;
nemubot§ list modules
  - hello ;

connect

Connect to a server

Example:

nemubot§ connect irc.freenode.org:6667
irc.freenode.org:6667§ connect

join

Join a new channel.

Example:

irc.freenode.org:6667§ join #gentoo
irc.freenode.org:6667§ join #secretchannel password

leave

Leave a channel.

Example:

irc.freenode.org:6667§ leave #gentoo
irc.freenode.org:6667§ leave #secretchannel

send

Send a message on a channel.

Example:

irc.freenode.org:6667§ send #secretchannel "Hello world!"

disconnect

Disconnect from a server

Example:

irc.freenode.org:6667§ disconnect
nemubot§ disconnect irc.freenode.org:6667

zap

Reverse internal connection state without check

Example:

nemubot§ zap irc.freenode.org:6667
irc.freenode.org:6667§ zap

top

Print the bot current load and launched thread stacktrace.

Example:

nemubot§ top
[cmd_server] Queue size: 0, 1 thread(s) running (counter: 1)
[cmd_server] Events registered: 26, next in 32 seconds
[cmd_server] ################ Stack trace for thread -1265634192 ################
  File "/usr/lib/python3.2/threading.py", line 713, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.2/threading.py", line 740, in _bootstrap_inner
    self.run()
  File "nemubot/consumer.py", line 137, in run
    stm = self.context.cnsr_queue.get(True, 20)
  File "/usr/lib/python3.2/queue.py", line 194, in get
    self.not_empty.wait(remaining)
  File "/usr/lib/python3.2/threading.py", line 241, in wait
    gotit = waiter.acquire(True, timeout)

netstat

Display information about connected bots.

Example:

nemubot§ netstat
Distant bots connected: 1:
# irc.freenode.org:6667/[email protected]:
  * Declared hooks:
    - <irc_hook>
    - <cmd_hook> syno, listvars, ycc, imdb
    - <ask_hook>
    - <msg_hook>
  * My tag: 14
  * Tags in use (45):
    - b'\x0e\x11': NOMORE #nemutest « None »