3. Develop your bot (5 mins)
This step creates a bot file, then run it with one CLI command.
Prerequisite: QueryStar SDK, and a QueryStar token saved as
QUERYSTAR_TOKEN as an environment variable.
Step 1: Create a Python file
Open your favorite code editor, paste the follow script in a file, and name the file
import querystar as qs
# Triggered by new messages sent to channel #introduction
# Send a message to channel #introduction saying 'Hello!'
You can find your channel id here:
Step 2: Add
Querystar app to the channel
On the channel config page, under
QueryStarin the app list, click the
Step 2 can be skipped if QueryStar has been already added to the channel of interest. You can verify it here:
Step 3: Run the bot
In your terminal, make sure you are in the folder where `bot.py`` is, then run this command:
$ querystar run bot.py
Now switch to Slack to test. Your bot should respond to any new message now::::
And, you will see this message in the terminal:
It means a full cycle of
Trigger -> Action has been completed.
🥳 Congratulations to you for making the bot .
More demos can be found in page