This bot hooks into WPI's Student Government's Financial Database to provide realtime statistics inside of their internal Slack.
- Node Version Manager - Used to install and manage node instances.
- Yarn - Used inplace of NPM for getting node packages.
- Docker - Used in the Docker install
- Creation of a SlackBot in your workspace (See Notes for a video link)
There are two ways to install this slack bot: With Yarn, and with Docker.
- Clone this git repository to an Ubuntu Machine
- cd into the cloned folder and run
yarn
- Once all dependecies are installed, create a file called
secrets.js
with the following content inside of thesrc
folder:export const SLACK_OATH_TOKEN = '[YOUR-TOKEN]' export const HOST = 'webdb.wpi.edu' export const USER = '[USERNAME]' export const PASSWORD = '[PASSWORD]'
- Edit
constants.js
and designate a channel for spam from the bot (Default is#bot-spam
) - Go back to the main folder (
wpifinbot
) and runyarn start
. - If everything is properly set up, you should see a console command saying
bot started
andBot version 0.0.2 online
in the designated bot spam channel.
- Clone this git repository to a machine runnning docker
- cd into the cloned folder and run
docker build --tag wpifinbot:0.0.2
- run the following command with the taking note of the required fields
docker run --name wpifinbot \
-e BOT_SPAM_CHANNEL=[spam-channel] \
-e DB_DATABASE=[dbname] \
-e DB_HOST=[dbhost] \
-e DB_PASS=[dbpass] \
-e DB_USER=[dbuser] \
-e SLACK_OATH_TOKEN=[token] \
wpifinbot:0.0.2
- If everything is properly set up, you should see a console command saying
bot started
andBot version 0.0.2 online
in the designated bot spam channel.
- To properly install nvm and yarn, I recommend watching this video from Techno Tim
- This slack bot only works when it is running, meaning a dedicated machine is needed.
- In order to properly set up a slack bot and gain a Slack OATH Token, follow along with this video from Techno Tim
- The bot must be added to the channel you want results in.
- For the docker install, the spam channel must have the leading pound sign. Example:
BOT_SPAM_CHANNEL=#bot-spam
!numbers
- Gives the current Budget, FR, Mandatory Transfer Allocations, and Number of Active/Inactive Clubs!recents
- Returns the requests from the past week. (If none, returnNo requests in the past seven days!
)
!help
- Gives information on current commands and bot version number!classes
- Returns the Current Class Structure, Number of Clubs in that Class, and a short description
This bot was created by Kevin Bimonte.