Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
module:ircbot [2019/04/24 12:19] – Removed editorials. Adjusted some formatting and branding. Added some info re: running the bot. Advice about which port number to use would belong in the ircd wiki page if anywhere. I didn't understand the bit about 'passwords', so I removed it. ecbbsmodule:ircbot [2019/05/30 23:43] (current) – Created sections digital man
Line 1: Line 1:
 ====== IRC Bot ====== ====== IRC Bot ======
  
-<code> +===== Install =====
-<cellguy> can anyone answer a Sychronet IRC question for me?  has to do with the bot scripts included with synchronet package +
-<cellguy> How do you get them working?  Cant find any documentation on them +
-<cellguy> need to get one oman IRC channel on my server +
-<cellguy> saw them in the directory and looked at the configs, just need a jump start +
-<Troice> You set up the ini file and run it using jsexec. +
-<cellguy> ok sweet, thats the jump start I was looking for +
-<Troice> ctrl/ircbot.ini +
-<Troice> sbbs/exec/jsexec -d ircbot.js +
-<cellguy> thanks a bunch +
-</code> +
- +
--------------------------------------------------------------------------------------------------------------------------------------------- +
- +
-**Installation**+
  
 The IRC bot is included with Synchronet BBS, at ''exec/ircbot.js'' Additional IRC bot modules are available in ''exec/ircbots/''. The IRC bot is included with Synchronet BBS, at ''exec/ircbot.js'' Additional IRC bot modules are available in ''exec/ircbots/''.
  
-**Configuration**+===== Configure =====
  
-The IRC bot configuration file is ''ctrl/ircbot.ini''.+The IRC bot configuration file is [[:config:ircbot.ini:]].
  
 <code> <code>
Line 33: Line 19:
  
 //Notes:// //Notes://
-  - If you are running the Synchronet ircd, you can connect the bot to localhost, 127.0.0.1, or the specific interface that the ircd binds to as configured in ''ctrl/services.ini'' +  - If you are running the Synchronet ircd, you can connect the bot to localhost, 127.0.0.1, or the specific interface that the ircd binds to as configured in [[:config:services.ini:]] 
-  - You may place more than one server section in ''ctrl/ircbot.ini'', however connecting to multiple servers with one bot currently does not work.  Instead, you would need to run multiple instances of ircbot.js.+  - You may place more than one server section in [[:config:ircbot.ini:]], however connecting to multiple servers with one bot currently does not work.  Instead, you would need to run multiple instances of ircbot.js.
  
 **Modules** **Modules**
Line 60: Line 46:
 [module_Antispam] [module_Antispam]
 global=true global=true
 +channels = #channelname
 dir=/sbbs/exec/ircbots/antispam/ dir=/sbbs/exec/ircbots/antispam/
  
Line 106: Line 93:
  
 [module_RPG] [module_RPG]
 +channels = #channelname
 dir=/sbbs/exec/ircbots/rpgbot/ dir=/sbbs/exec/ircbots/rpgbot/
 </code> </code>
  
 //Notes// //Notes//
-  - Google seems to have some file dependencies and doesn't execute so I have it commented out.  +  - Google seems to have some missing file dependencies and doesn't execute so I have it commented out.  
   - No trivia directory although it is listed in the ini file.     - No trivia directory although it is listed in the ini file.  
 +  - Add a module to a channel by adding the line channels = #channelname to the block.
   - Otherwise, by adding the modules to the ini and restarting the bot you may make these available in your ircd.   - Otherwise, by adding the modules to the ini and restarting the bot you may make these available in your ircd.
-  
  
 **Running the IRC Bot** **Running the IRC Bot**
Line 132: Line 120:
 You can add '' -f /some/other/ircbot.ini'' to the //Command// line to specify an alternate configuration file. You can add '' -f /some/other/ircbot.ini'' to the //Command// line to specify an alternate configuration file.
  
 +===== Use ===== 
  
-**Using the IRC Bot**   +  - See the help menu by sending **/msg <botnick> help**. 
- +  - Some commands are restricted and will not show up in the help menu (or be usable), until you have identified yourself to the bot.  To identify, use **/msg <botnick> identify <password>**.  (Your IRC nickname must be the same as your username on the BBS for this to work.)
- +
-//Notes// +
-  - See the help by sending **/msg <botnick> help**. +
-  - You will need to **/msg <botnick> IDENT <password>** against your bot to see the full menu of items+
    
 Without **IDENT** the help looks like; Without **IDENT** the help looks like;
Line 193: Line 178:
 for help with the editor, type 'rpg help editor' for help with the editor, type 'rpg help editor'
 </code> </code>
 +
 +The main module functions are contained in the ''/exec/load/ircbot_commands.js'' file.  All other modules are free standing and have separate files in their respective directories under ''/exec/ircbots/'' The help associated with the various modules/commands is not complete.  if you choose to add/update look for the lines;
 +
 +<code>
 +Bot_Commands["RELOAD"].usage =
 + get_cmd_prefix() + "RELOAD";
 +Bot_Commands["RELOAD"].help = 
 + "Reloads the internal bot command and function structure.  No arguments.";
 +</code>
 +
 +This is an example from the command RELOAD.
 +The usage line dictates the syntax required to execute the command.
 +The help line contains a text description of the command's function.
 +
 +**Module Main**
 +  * reload - Reloads the internal bot command and function structure.  No arguments. (see note below)
 +  * load - ??? Unconfirmed ??? I suspect this loads messages from a BBS message area but am unable to get this working.
 +  * join - Instructs the specified bot to JOIN a new channel. [Note: may also be specified in the [[:config:ircbot.ini:]] file as well]
 +  * part - Instructs the specified bot to dePART from a channel.
 +  * die - Causes bot to die (shut down). You don't want that, do you?
 +  * restart - Forces bot to restart, only works with bots running as a service.  If using JSExec the bot will DIE but not restart.
 +  * help - Displays helpful information about bot commands.
 +  * ? - This is the same as help above [Note: This is a command alias, created via //Bot_Commands["?"] = Bot_Commands["HELP"];//
 +  * ident - Identifies a user by alias and password. Use via private message only. [Note: create an alias for IDENT too.]
 +  * addquote - Adds a quote from your nick to the database.  Use QUOTE to see. [Note: quotes held in [[:config:ircbot.ini:]] file appended to bottom.]
 +  * quote - QUOTE returns quote assoicated with your nick, or search for a string to quote.
 +  * greet - Sets or clears the greeting I will display when you enter the room.
 +  * save - ??? Unconfirmed ??? Save some data locally?
 +  * prefix - Changes the bot command prefix. Default is BOT. Only needed in channels, not in private msgs.
 +  * nick - Change the bots nickname.
 +  * module - Toggle the status of modules in channels.
 +  * modules - Same as modules above.
 +  * abort - Instruct the bot to ABORT server output.
 +  * ignore - Tell the bot to IGNORE the specified nickname.
 +
 +Note: The RELOAD command throws an error in it's default config. This should result in reloading [[:config:ircbot.ini:]] as well as all the modules, but fails with the following error;
 +
 +<code>
 +TypeError: redeclaration of const MODULE_NAME
 +file: /sbbs/exec/ircbots/presence/presence.js
 +line: 27
 +</code>
 +
 +You may comment out this section in the ''/exec/load/ircbot_commands.js'' file to avoid, but then you don't RELOAD modules, just the bot.
 +
 +<code>
 +Bot_Commands["RELOAD"].command = function (target,onick,ouh,srv,lvl,cmd) {
 + srv.o(target,"Reloading the bot configuration...","NOTICE");
 + load("load/ircbot_commands.js");
 + load("load/ircbot_functions.js");
 + for(var m in Modules) {
 + /* Don't reload libraries?? 
 + for(var l in Modules[m].load) {
 + if(Modules[m].load[l]) load(Modules[m],Modules[m].load[l]);
 + } */
 + }
 + srv.o(target,"Reloaded.","NOTICE");
 + return;
 +}
 +</code>
 +
 +I'll start creating separate pages for the other modules as I work though them.
  
 ===== See Also ===== ===== See Also =====
   * [[:module:|module index]]   * [[:module:|module index]]
  
-{{tag>}}+{{tag>irc chat}}