3.6. Connectors
Connectors
Using connectors you can run your agent at external sources. For example, it could be a Telegram bot or VK community messages.
When creating or editing a connector, you need to give it a name, select the agent to be connected to it (the agent must be public), and choose the connector type.
After selecting the connector type, you will need to configure the connection for it. For example, when creating a Telegram connector, you will need to obtain a bot token and save the connection.
If the agent is unable to answer a user's question via the connector, a human operator can respond through the control panel, and the message will be sent to the user via the specific channel they used.
Telegram integration
To integrate with Telegram, you will need a bot that users can interact with.
To do this, go to @BotFather in Telegram and open the mini-app. Fill in all the required fields and copy the token:
Next, go to the Connectors section on the platform, create a new connector by selecting your public agent, choose the Telegram connector type, and paste your token:
Once saved, the bot will immediately begin working for your agent.
If the bot is unable to provide an answer to a user, a notification will appear in the operator's control panel; the operator can then respond to the inquiry, and that response will be delivered to the user via the bot.
If you need help setting up an agent, just get in touch with us.
Integration with a VK community
You can configure your agent to respond to messages in a VK community.
To get started, go to your community settings and enable community messages:
After that, also go to the bot's settings section and enable the following features:
Next, go to the "Advanced" section -> "Working with API" and create an API key:
Now go to the Callback API section. There, you will need to copy the group ID (look for the numbers next to "Group ID") and the code shown after "String to be returned by the server":
Now, proceed to create a connector on the platform, select your public agent, and specify the connector type as "VK Community messages."
Then, enter the API key, group ID, and the string that the server is expected to return - all of which you copied earlier - into the corresponding fields:
Save your changes. Below, in the same form, you will see the information required for connection. Copy the string from the "Server URL" field.
And paste it into the "Address" field in the Callback API settings:
Also, under event types, select the necessary permissions for the messages to which the agent should respond:
After that, go back and click "Confirm." If everything is set up correctly, the VK connector will start working immediately:
If you need help setting up an agent, just get in touch with us.
Integration with Discord
To integrate with a Discord server, you need to go to the Discord Developer Portal (https://discord.com/developers/applications) and create an application:
In the application's main settings, copy the Application ID and Public Key:
Next, go to the Bot tab and locate the Token field. Click the Reset button and copy the token:
On the same tab, scroll down a bit and enable Message Content Intent:
Next, go to the OAuth tab and, in the OAuth2 URL Generator section, select bot and application.commands:
A little further down, you will see a "Bot Permissions" section. Select the following permissions: Send Messages, Send Messages in Threads, Read Message History, and Use Slash Commands:
After that, a link will appear below. Follow this link and add the channel where you would like the agent to operate:
Next, go to the platform, create a connector of the Discord type, and select your public agent.
In the fields that appear, paste the previously copied values:
And save your widget. Once saved, copy your connector ID from the browser's address bar (everything that follows `/connectors/`):
Go back to the Discord application and, in the main settings, locate the Interactions Endpoint URL:
You need to insert a link there that includes your Connector ID:
https://tozhebot.ru/api/webhooks/discord/{YOUR_CONNECTOR_ID}
And save your changes. After that, your agent will be active on Discord.
You can test it using the /ask command in your channel.
If you need help setting up an agent, just get in touch with us.