Skip to content

declanwhchan/Slack-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack Bot

A simple Slack bot built with Node.js and Slack Bolt. It runs in Socket Mode and provides fun slash commands for pinging, jokes, facts, dice rolls, choices, quotes, and Magic 8 Ball answers.

Setup

Clone the repository:

git clone https://github.com/declanwhchan/Slack-Bot.git
cd Slack-Bot

Install dependencies:

npm install

Create a .env file in the project root:

SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-token

Run the bot:

node index.js

If it starts successfully, the terminal will show:

bot is running!

Commands

Command Description
/pp-ping Check bot latency
/pp-catfact Get a cat fact
/pp-joke Get a random joke
/pp-coinflip Flip a coin
/pp-roll Roll a die, like /pp-roll 20
/pp-choose Pick from options, like /pp-choose pizza, sushi, tacos
/pp-quote Get a random quote
/pp-8ball Ask the magic 8 ball a question
/pp-pi Show pi to 0-500 decimal places, like /pp-pi 50
/pp-help Show all commands

To add new commands edit index.js and ensure to update the "Slash Commands" in https://api.slack.com/apps.

Notes

Do not commit your .env file. It contains private Slack tokens and is ignored by Git.

About

Customizable Slack Bot that runs 24/7 on slack.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors