A running SlackBot project for my team's channels at work. It's designed to provide basic everyday functions. I've used the slackbot framework for some structure. In addition, some base functions are extended from the Limbo library, as not to reinvent the wheel.
Current plugins and commands include:
- Calculate
- Solve a mathematical expression. (Extends Limbo).
calc [expression]
calculate [expression]
solve [expression]
- Solve a mathematical expression. (Extends Limbo).
- General
- Show the available list of officebot commands.
commands
help
what can you do
what you can do
- Show the bot's description. This should be defined in
config.yml
asdescription
.about yourself
- Show the bot's company. This should be defined in
config.yml
ascompany
.who do you work for
your job?
- Show the bot's name. This should be defined in
config.yml
asname
.your name
who are you
- Show the available list of officebot commands.
- Google
- Search for something and retrieve the top result. (Extends Limbo).
google [query]
look up [query]
search [query]
- Search for something and retrieve the top result. (Extends Limbo).
- Jokes
- Say a random Chuck Norris joke. Uses the
The Chuck Norris Internet Database API.
chuck norris joke
- Say a random Chuck Norris joke, but with a team member's name
instead.
make [user] feel better
cheer [user] up
cheer up [user]
- Say a Horatio Caine style one-liner. If no quote is defined, say a
random one.
csi joke [quote 1] [quote 2]
horatio joke [quote 1] [quote 2]
horatio caine joke [quote 1] [quote 2]
- Say a random Chuck Norris joke. Uses the
The Chuck Norris Internet Database API.
- Map
- Show a map of an area. (Extends Limbo).
map [query]
show me [query]
where is [query]
- Show a map of an area. (Extends Limbo).
- Podcasts
- Retrieves the name of a Random podcast from the iTunes Top 100. Uses the
Apple iTunes API.
podcast
- Retrieves the name of a Random podcast from the iTunes Top 100. Uses the
Apple iTunes API.
- Quotes
- Recite a DJ Khaled quote.
motivate
motivation
motivational
khaled
- Recite a DJ Khaled quote.
- Random
- Choose a random team member.
random member
random person
random team member
random user
- Flip a coin.
coin flip
flip a coin
- Choose a random team member.
- Wikipedia
- Retrieves some information from
Wikipedia. (Extends Limbo).
what do you know about [query]
wiki [query]
wikipedia [query]
- Retrieves some information from
Wikipedia. (Extends Limbo).
-
Fork it!
-
Create a local clone of your fork.
$ git clone https://github.com/YOUR-USERNAME/officebot
-
Set up a clean working environment, using virtualenv.
$ virtualenv venv -p python3 $ source venv/bin/activate $ pip install -r requirements/development.txt
-
For the bot to work properly, a
config.yml
file must be created. You can get this from your Bot's API token from its page upon creation. Add the following line and format toconfig.yml
.api-key-bot-token: 'YOUR-BOT-API-KEY'
-
In order to run office bot, execute the main script.
`$ python run.py`.
- Unit tests