xakpc / FeedbackBots

Chatbot for gathering feedback built with Azure Durable Functions

Home Page:https://feedbackbots.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FeedbackBots

Feedback Bots allows you to deploy a feedback chatbot with master chatbot. Built on Azure Durable Functions as a part of PlanetScale and Hashnode hackathon. Read an article how it was built here

Deploy

  1. Deploy Feedback bots to Azure, open Azure Function App configuration
  2. Create Database tables from Database.sql in MySQL-compatible database

Setup Azure Function App

  1. Set Uri to a FQDN of your Azure Function App (without https://)
  2. Set ConnectionString:Default to a connection string of your MySQL-compatible database
  3. Create a Host key for your functions in App Keys blade of your Azure Function App
  4. Set ClientId to a created key - it will be used to auth webhooks

Setup Master Bot

  1. Create a Master Bot using @BotFather
  2. Set MasterToken setting to the chatbot token obtained from BotFather
  3. Execute api/setup function with admin key - this will setup webhook for your master bot
  4. Send /start to master bot, check logs of MasterBotWebhook for message like Got message: User sent message 123 to chat **123456789** at 30.07.2022 22:23:14.
  5. Set MasterChatId to your chat number id

Setup Client Bots

Now your Master Bot is operational and you are ready to add client bots

  1. Create a Client Bot using @BotFather
  2. Send /add command to Master Bot
  3. Send client bot's token to a master bot, the confirmation message should return

Setup is done, now any message to Client Bot will be forwarded to a Master Bot. Reply on Message in Master Bot to send back answer.

SaaS version

Feedback bots availibe as SaaS solution (pre-deploed and pre-setup for you) on FeedbackBots.com

Configuration

The next configuration required to functions properly operate

Example of local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "Uri": "uri for webhooks",
    "MasterToken": "user-token for MasterBot",
    "MasterChatId": "your chat-id in MasterBot",
    "ClientId": "local"
  },

  "ConnectionStrings": {
    "Default": "MySql Connection String"
  }
}

About

Chatbot for gathering feedback built with Azure Durable Functions

https://feedbackbots.com

License:GNU Affero General Public License v3.0


Languages

Language:C# 100.0%