Simple slack slash command for solving math problems
- Based on Wolfram|Alpha APIs
- Simple to use
- Python3 support
- Can reply to any math problems
git clone https://github.com/TopKeingt/Math-Genie
or click here to download respository's zip file.
python -m pip install -r requirements.txt
You need to create a wolfram app id (the core of the program to work)
Because the program will run on Slack so you need to get slack api token to able to communicate.
Slack is a collaboration hub for work, no matter what work you do. It’s a place where conversations happen, decisions are made, and information is always at your fingertips. With Slack, your team is better connected.
-
Go to api.slack.com
-
Create a new Slack Applications or use your old Slack App (this project only add one slash command to your bot).
-
Copy Vertification Token and paste to
SLACK_VERTIFICATION_TOKEN
in config.ini -
Go to Slash Commands
-
Go to OAuth & Permissions
- Select
Send messages as [app's name]
under Scopes and click Save Changes
- Click Install App to Workspace on the very top of the page and authorize your app to communicate with your slack's workspace.
- When successfully authorized, it will redirected back to your app page. Copy OAuth Access Token and paste to
SLACK_BOT_TOKEN
in config.ini.
- Select
Now you will able to run the program with python
❗ Any missing value in config.ini will break the program. Please follow the instruction above to fill out the configuration.
The example of what config.ini should look like: How to run ?
$ python main.py --help
usage: main.py [-h] [-p] [-d]
Run the program in [mode]
optional arguments:
-h, --help show this help message and exit
-p, --production Run the program in production mode
-d, --development Run the program in development mode
example:
$ python main.py --development
* Restarting with stat
* Debugger is active!
* Debugger PIN: 232-100-363
* Running on http://127.0.0.1:3000/ (Press CTRL+C to quit)
since slack's app doesn't allow slash commands to use local url like http://127.0.0.1:3000
as Request Url please use ngrok to generate public url.
$ ngrok http 5000
ngrok by @inconshreveable (Ctrl+C to quit)
Session Status online
Account TopKeingt (Plan: Free)
Version 2.2.8
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://30081a1a.ngrok.io -> localhost:3000
Forwarding https://30081a1a.ngrok.io -> localhost:3000
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
and use http://[ngrok's id].ngrok.io
as Request Url