Skip to main content

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 Integrations tab, click Add apps button.

  • Then find QueryStar in the app list, click the Add button.


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 ``` is, then run this command:

$ querystar run

Now switch to Slack to test. Your bot should respond to any new message now:


And, you will see this message in the terminal:


Running:: triggers.slack.new_message
Finished:: triggers.slack.new_message
Running:: actions.slack.add_message
Finished:: actions.slack.add_message

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 Tutorials.