Creating Bots

Creating a bot using Bot Studio is straightforward. You just need to fill in some basic configurations, and then you can create your bot. Here’s how you can create a bot:

Telegram Bot

  1. Click on the “Create Bot” button on the sidebar of the dashboard page.
  2. Select the Telegram platform and click on the “Next” button.
  3. In the configuration form, enter a name for your bot (minimum of 2 letters).
  4. Enter the token you’ve received from Telegram’s @BotFather.

To get a @BotFather token:

  1. Open the Telegram app and send a message to @BotFather.
  2. Send the /newbot command and fill all required forms to create a bot.
  3. After creating a bot, @BotFather will send you a message with your bot token. Use this token in Bot Studio’s Telegram configuration.

When creating Telegram bots for a Telegram channel, the bot must have the capability to read events. For instance, it should be able to process message events and message contents to respond to messages or manage groups to perform tasks such as changing profile pictures.

Discord Bot

  1. Click on the “Create Bot” button on the sidebar of the dashboard page.
  2. Select the Discord platform and click on the “Next” button.
  3. In the configuration form, enter a name for your bot (minimum of 2 letters).
  4. Enter the token you’ve received from the Discord Developer Portal.

To get a Discord Developer Portal token:

  1. Go to the Discord Developer Portal.
  2. Create a new application and click on the “Bot” button on the sidebar.
  3. Click on the “Reset Token” button and copy the new Discord token. Use this token to configure your bot.

When adding a Discord bot to your channel, it must have the ability to read events and messages. For instance, it needs to be able to read messages to respond to message events or to access message content for certain features. It’s advisable to grant your bot access to all necessary features.

WhatsApp Bot

  1. Click on the “Create Bot” button on the sidebar of the dashboard page.
  2. Select the WhatsApp platform and click on the “Next” button.
  3. In the configuration form, enter a name for your bot (minimum of 2 letters).
  4. Scan the QR code using your WhatsApp account. Visit the official WhatsApp website to learn how to scan a new QR code.

After filling in the configuration, read Bot Studio’s “Terms & Conditions”. If you agree with these terms, go to the next form and check the accuracy of the configuration. Then click on the “Create” button and wait for the process to finish.

If the bot was successfully created, you’ll be redirected to the dashboard and be able to manage your bot from the “Bots” sub-menu. If you face any issues, you’ll see a notification about the issue cause.

Bot Studio’s WhatsApp bots do not utilize official WhatsApp services. If these bots are employed for spamming or disseminating viruses, WhatsApp may suspend the associated account. It is recommended to utilize these bots solely within group chats.

Slack Bot

  1. Click on the “Create Bot” button on the sidebar of the dashboard page.
  2. Select the Slack platform and click on the “Next” button.
  3. In the configuration form, enter a name for your bot (minimum of 2 letters).
  4. Enter the token you’ve received from the Slack Applications.

To get a Slack Applications token:

  • Go to the Slack Applications.
  • Click on the “Create New App” button.
  • Click on the “From an app manifest” option.
  • Pick a workspace to develop your app in and click on the “Next” button.
  • Enter one of the following data sets as the manifest for your app:
YAML
display_information:
  name: "Bot Studio"
  description: "www.botstudioo.com"
  long_description: "This robot was crafted using Bot Studio's no-code robot maker, available at www.botstudioo.com. The details provided serve as an illustration of Bot Studio's capabilities within Slack, and they can be tailored to suit your specific requirements."
features:
  app_home:
    home_tab_enabled: true
    messages_tab_enabled: true
  bot_user:
    display_name: "Bot Studio"
oauth_config:
  scopes:
    bot: ["app_mentions:read", "im:history", "bookmarks:read", "bookmarks:write", "calls:read", "calls:write", "canvases:read", "canvases:write", "channels:history", "channels:join", "channels:manage", "channels:read", "channels:write.invites", "channels:write.topic", "chat:write", "chat:write.customize", "chat:write.public", "commands", "conversations.connect:manage", "conversations.connect:read", "conversations.connect:write", "dnd:read", "emoji:read", "files:read", "files:write", "groups:history", "groups:read", "groups:write", "groups:write.invites", "groups:write.topic", "im:read", "im:write", "im:write.invites", "im:write.topic", "incoming-webhook", "links.embed:write", "links:read", "links:write", "metadata.message:read", "mpim:history", "mpim:read", "mpim:write", "mpim:write.invites", "mpim:write.topic", "pins:read", "pins:write", "reactions:read", "reactions:write", "reminders:read", "reminders:write", "remote_files:read", "remote_files:share", "remote_files:write", "team.billing:read", "team.preferences:read", "team:read", "usergroups:read", "usergroups:write", "users.profile:read", "users:read", "users:read.email", "users:write", "workflow.steps:execute"]
settings:
  event_subscriptions:
    request_url: https://webhook.botstudioo.com/slack
    bot_events: ["app_mention", "message.channels", "message.groups", "message.im", "message.mpim"]
JSON
{
  "display_information": {
    "name": "Bot Studio",
    "description": "www.botstudioo.com",
    "long_description": "This robot was crafted using Bot Studio's no-code robot maker, available at www.botstudioo.com. The details provided serve as an illustration of Bot Studio's capabilities within Slack, and they can be tailored to suit your specific requirements."
  },
  "features": {
    "app_home": {
      "home_tab_enabled": true,
      "messages_tab_enabled": true
    },
    "bot_user": {
      "display_name": "Bot Studio"
    }
  },
  "oauth_config": {
    "scopes": {
      "bot": ["app_mentions:read", "im:history", "bookmarks:read", "bookmarks:write", "calls:read", "calls:write", "canvases:read", "canvases:write", "channels:history", "channels:join", "channels:manage", "channels:read", "channels:write.invites", "channels:write.topic", "chat:write", "chat:write.customize", "chat:write.public", "commands", "conversations.connect:manage", "conversations.connect:read", "conversations.connect:write", "dnd:read", "emoji:read", "files:read", "files:write", "groups:history", "groups:read", "groups:write", "groups:write.invites", "groups:write.topic", "im:read", "im:write", "im:write.invites", "im:write.topic", "incoming-webhook", "links.embed:write", "links:read", "links:write", "metadata.message:read", "mpim:history", "mpim:read", "mpim:write", "mpim:write.invites", "mpim:write.topic", "pins:read", "pins:write", "reactions:read", "reactions:write", "reminders:read", "reminders:write", "remote_files:read", "remote_files:share", "remote_files:write", "team.billing:read", "team.preferences:read", "team:read", "usergroups:read", "usergroups:write", "users.profile:read", "users:read", "users:read.email", "users:write", "workflow.steps:execute"]
    }
  },
  "settings": {
    "event_subscriptions": {
      "request_url": "https://webhook.botstudioo.com/slack",
      "bot_events": ["app_mention", "message.channels", "message.groups", "message.im", "message.mpim"]
    }
  }
}

Please note that these manifest files will grant all permissions to your Slack bot. You can develop your robots first and then remove any unnecessary bot scopes later.

  • Click on the “Next” button after entering the custom manifest.
  • Review the summary and make sure everything is okay. Then click on “Create” to create your application.
  • After your application has been created, you’ll be redirected to your app page. Click on the “Install to Workspace” button and install this app.
  • In the “Features” group, click on “OAuth & Permissions”.
  • Scroll to see a section named “OAuth Tokens for Your Workspace”.
  • Copy the “Bot User OAuth Token” and paste it as the “Slack Application Token” in Bot Studio, and create your bot.

This manifest only includes message events. If you wish to use custom event listeners, such as the “Channel Left Event”, you must navigate to the “Event Subscriptions” page under the “Features” tab. From there, scroll down to the “Subscribe to bot events” section, where you can add custom event listeners.

Setting the webhook address for your Slack bot

After completing these steps, your robot will be created in Bot Studio. Now there are a few other steps to complete:

  1. Return to Bot Studio’s dashboard and click on your robot from the “Robots” submenu.
  2. Copy the value of “webhook address”, which looks like this: https://webhook.botstudioo.com/slack/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
  3. Go back to your Slack application, and in the “Features” group, click on “Event Subscriptions”.
  4. Paste the webhook URL address you copied from the bot’s dashboard into this.
  5. Then, as you can see, the URL has been verified successfully. Click on the “Save Changes” button.

Setting the signature for your Slack bot

You must set a signature for your bot requests. This step is optional, but if you want to secure your robot, you have to do this:

  1. In the “Settings” group, click on “Basic Information”.
  2. Scroll down to the “App Credentials” section.
  3. Copy the “Signing Secret” value.
  4. Return to Bot Studio’s dashboard and click on your robot from the “Robots” submenu.
  5. Click on the “Options” button at the top of your robot page and click on the “Change Signature” option.
  6. Paste the signature into the input and click on the “Change” button.

Enabling slash commands and sending direct messages to your Slack bot

If you wish to send slash commands and direct messages to your robot, you can optionally follow the steps below:

  1. In the “Features” group, click on “App Home”.
  2. Scroll down to the “Show Tabs” section and make sure the “Allow users to send Slash commands and messages from the messages tab” option is checked.

Managing event subscriptions for your Slack bot

You need to inform Slack about the events you want your robot to receive. While you can create an event listener node on Bot Studio, it won’t be able to notify you until you subscribe to that event within Slack.

To manage your robot’s subscriptions to Slack events, navigate to the “Event Subscriptions” page under the “Features” tab. Scroll down to the “Subscribe to bot events” section, where you can add custom event listeners. From there, you can select and add the events you wish to receive from Slack and handle them using Bot Studio.

Managing your Slack bot permissions

For security reasons, each Slack token has access to a specific set of permissions. For instance, if your robot intends to send a message to a chat, it must be granted permission to send chat messages.

To manage your Slack robot’s permissions, navigate to the “OAuth & Permissions” page under the “Features” tab. Scroll down to the “Scopes” section, where you can manage and customize the permissions your robot possesses.

Additional Resources