Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

2. Jabber Ping Setup

shibdib edited this page Jun 27, 2016 · 4 revisions

Jabber Ping Echoing

The filereader plugin has the ability to echo anything placed into a tmp/discord.db file. Which in this example will be jabber pings using the Twisted bot. The twisted bot will automatically generate the discord.db file

  1. To enable this feature go into your bots config and uncomment the plugin fileReader

  2. Next we need to install pip sudo apt-get install python-pip python-pygments

  3. Then cd /bots_directory/src/twisted

  4. Followed by pip install -r requirements.txt (This will install the required libraries for the twisted bot)

  5. Once that is done find the config.yaml.jabber.example file and fill in the network, server, username, nickname, and password sections with your jabber account information. (I recommend using an alt that will not get messages for this or you risk sharing private jabber messages)

  6. Next step is to update our supervisor .conf file we created when installing the main bot. Re-open that file and change it to the following. (If you're familiar with supervisor feel free to customize)

     [program:dramiel]
     command=php /**bot location**/Dramiel/Dramiel.php 
     autostart=true  
     autorestart=true  
     stopasgroup=true  
     stderr_logfile=/**bot location**/Dramiel/log/dramielError.log 
     stdout_logfile=/**bot location**/Dramiel/log/dramielOther.log 
     stdout_logfile_maxbytes=100KB  
     stdout_logfile_backups=5  
     stderr_logfile_maxbytes=100KB  
     stderr_logfile_backups=5  
     killasgroup=true  
     priority=998  
    
     [program:twisted]  
     command=/usr/bin/python /**bot location**/Dramiel/src/twisted/run.py -c /home/Dramiel/src/twisted/config.yaml.jabber  
     directory=/discord_bot_location/Dramiel/src/twisted   
     autostart=true  
     autorestart=true  
     stderr_logfile=/**bot location**/Dramiel/log/twisted.err.log  
     stdout_logfile=/**bot location**/Dramiel/log/twisted.out.log  
     stdout_logfile_maxbytes=100KB  
     stdout_logfile_backups=5  
     stderr_logfile_maxbytes=100KB  
     stderr_logfile_backups=5  
     killasgroup=true  
     priority=998  
    
     [group:dram]  
     programs=dramiel,twisted  
     priority=999  
    

You will then need to run supervisorctl update which will start both bots.

To control the bot for now on you must use supervisorctl stop/start/restart dram:*

The configuration of the ping bot portion is fairly self explanatory.

"channelConfig" => array(
  "pings" => array(
    "default" => true, // is this particular filter active?
    "searchString" => "broadcast", // The plugin will search for this string and post any messages that contain it. To have the bot share everything change it to false without any quotes.
    "textStringPrepend" => "@everyone |", // this prepend will ping all discord users with access to the channel
    "textStringAppend" => "", // anything ud like to add to the tail end of the bots message
    "channelID" => 119136919346085888 // channel it posts too
  ),
Clone this wiki locally