Using Chatwee and Botstar to Make Your Performance Art Project More Engaging with Chatbots

Question:

How can I integrate a simple chatbot into a Chatwee chatroom for a performance art project?

I am working on a performance art project that involves a chatroom where the audience members can interact with each other, the performer, and some chatbots. I have chosen Chatwee as the chatroom platform, and Botstar as the chatbot builder. I want the chatbots to post random messages at random intervals, and optionally respond to the audience if possible. However, I do not know how to connect the chatbots to the chatroom. I have seen that Chatwee has a bot feature on its demo chat, but I cannot find any documentation or support from Chatwee, which seems to be inactive since June 2022. I would appreciate any guidance or advice on how to achieve this integration. Thank you.

Answer:

Chatwee is a chatroom platform that allows you to create and customize your own chatrooms for various purposes. Botstar is a chatbot builder that lets you design and deploy chatbots for different platforms and channels.

In

this article, I will show you how to integrate a simple chatbot into a Chatwee chatroom for a performance art project that involves audience interaction.

Step 1: Create a Chatwee chatroom

The first step is to create a Chatwee chatroom for your project. You can sign up for a free account on Chatwee’s website and create a chatroom with the desired name, description, and settings. You can also customize the appearance and features of your chatroom, such as the color scheme, layout, moderation, and user roles. You can find more details on how to create and manage a Chatwee chatroom in their [documentation](https://chatwee.com/docs).

Step 2: Create a Botstar chatbot

The next step is to create a Botstar chatbot for your project. You can sign up for a free account on Botstar’s website and create a chatbot with the desired name, description, and icon. You can also choose a template or start from scratch to design your chatbot’s flow and logic. You can use Botstar’s visual editor or code editor to create your chatbot’s dialogues, actions, and variables. You can find more details on how to create and edit a Botstar chatbot in their [documentation](https://docs.botstar.com).

Step 3: Connect your Botstar chatbot to your Chatwee chatroom

The final step is to connect your Botstar chatbot to your Chatwee chatroom. This can be done by using Botstar’s webhook feature and Chatwee’s API. A webhook is a way for your chatbot to send and receive data from an external source, such as a chatroom. An API is a way for your chatroom to communicate with an external service, such as a chatbot. You can find more details on how to use Botstar’s webhook feature in their [documentation](https://docs.botstar.com/en/webhook.html) and how to use Chatwee’s API in their [documentation](https://chatwee.com/api).

Here are the steps to connect your Botstar chatbot to your Chatwee chatroom using webhook and API:

  • In

    your Botstar chatbot’s settings, go to the

    In

    tegrations tab and enable the webhook option. Copy the webhook URL and save it for later.

  • In

    your Chatwee chatroom’s settings, go to the API tab and enable the API option. Copy the API key and save it for later.

  • In

    your Botstar chatbot’s editor, create a new dialogue that will handle the incoming messages from your Chatwee chatroom. You can name it anything you want, such as “Chatwee”.

  • In

    the “Chatwee” dialogue, add a new action that will receive the webhook data from your Chatwee chatroom. You can use the “Receive Webhook Data” action and select the “JSON” format. You can also specify the name of the variable that will store the webhook data, such as “chatwee_data”.

  • In

    the “Chatwee” dialogue, add another action that will extract the relevant information from the webhook data, such as the message text, the sender name, and the chatroom ID. You can use the “Extract Data” action and select the “JSON” format. You can also specify the names of the variables that will store the extracted data, such as “message_text”, “sender_name”, and “chatroom_id”.

  • In

    the “Chatwee” dialogue, add another action that will check if the message text contains a keyword or phrase that you want your chatbot to respond to, such as “hello”, “how are you”, or “tell me a joke”. You can use the “Check Text” action and select the “Contains” option. You can also specify the name of the variable that will store the result of the check, such as “message_check”.

  • In

    the “Chatwee” dialogue, add a new branch that will handle the case when the message text contains the keyword or phrase that you want your chatbot to respond to. You can use the “If” condition and select the “message_check” variable. You can also specify the value of the variable that will trigger the branch, such as “true”.

  • In

    the “Chatwee” dialogue, add another action that will generate a response for your chatbot based on the message text. You can use the “Send Text” action and type in the response that you want your chatbot to say, such as “Hello, I am a chatbot”, “I am fine, thank you”, or “Here is a joke for you”. You can also use variables and expressions to make your response more dynamic and personalized, such as “Hello, {sender_name}, I am a chatbot”, “I am fine, thank you, how are you, {sender_name}?”, or “Here is a joke for you, {sender_name}: {random_joke()}”.

  • In

    the “Chatwee” dialogue, add another action that will send the response from your chatbot to your Chatwee chatroom. You can use the “Send Webhook Data” action and select the “JSON” format. You can also specify the webhook URL and the data that you want to send, such as “https://chatwee.com/api/send_message?api_key={chatwee_api_key}&chat_id={chatroom_id}&message={chatbot_response}&sender_name={chatbot_name}&sender_type=bot”.

  • In

    the “Chatwee” dialogue, add a new branch that will handle the case when the message text does not contain the keyword or phrase that you want your chatbot to respond to. You can use the “Else” condition and select the “message_check” variable. You can also specify the value of the variable that will trigger the branch, such as “false”.

  • In

    the “Chatwee” dialogue, add an action that will do nothing and end the dialogue. You can use the “End Dialogue” action and select the “Do Nothing” option.

  • Step 4: Test your integration

    The last step is to test your integration and see if your chatbot works as expected in your Chatwee chatroom. You can do this by:

  • Deploying your Botstar chatbot and copying its ID. You can find the ID in your chatbot’s settings, under the General tab.
  • Adding your Botstar chatbot’s ID to your Chatwee chatroom’s settings, under the Bots tab. You can also customize the name and icon of your chatbot in your chatroom.
  • Opening your Chatwee chatroom and sending a message to your chatbot. You should see your chatbot’s response in the chatroom.
  • Conclusion

    In

this article, I have shown you how to integrate a simple chatbot into a Chatwee chatroom for a performance art project. I hope this article was helpful and informative for you. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

Privacy Terms Contacts About Us