Skip to content

heku4/faqbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FAQBot

The Telegrm-bot FAQBot quickly answers questions. Questions and answers to them are stored in the file src/faq.json. The application uses the Telegram-bot client.

faq.json scheme

[
  {
    "Category" : "Common",
    "Question": "Who are you?",
    "Answer": {
      "Text" : "Hello! I am the Telegram-bot FAQBot.",
      "Type" : 0
    }
  },
  {
    "Category" : "Navigation",
    "Question": "Where (Venue)?",
    "Answer": {
      "VenueData": {
        "Latitude" : 50.0840172,
        "Longitude" : 14.418288,
        "Address" : "Husova, 110 00 Staré Město, Czechia",
        "Title" : "Man Hanging out"
      },
      "Type" : 1
    }
  },
  {
    "Category" : "Navigation",
    "Question": "Where (Location)?",
    "Answer": {
      "LocationData": {
        "Latitude" : 33.747252,
        "Longitude" : -112.633853
      },
      "Type" : 2
    }
  },
  {
    "Category" : "Media",
    "Question": "Any documents?",
    "Answer": {
      "DocumentData" : {
        "DocumentUrl" : "https://github.com/TelegramBots/book/raw/master/src/docs/photo-ara.jpg",
        "Caption" : "Ara bird."
      },
      "Type" : 3
    }
  },
  {
    "Category" : "Usefully",
    "Question": "Any contacts?",
    "Answer": {
      "ContactData": {
      "FirstName" : "Xek",
      "LastName" : "Xekov",
      "PhoneNumber" : "+0987654321"
      },
      "Type" : 4
    }
  }
]

The FAQ file contains array of objects. Each object has required fields:

- string Category,
- string Question, 
- object Answer

The content of the "Response" object depends on the type of message expressed as integer.

Message types

Specify the type of answer as a number.

0 - Text
1 - Venue
2 - Location
3 - Document
4 - Contact

Message Type Examples from .NET Client for Telegram Bot API: Text, Venue, Location, Document, Contact,

Commands

/showquestions - show all registered for the FAQbot questions.

/hotreload - reload questions and answers from the FAQ file without restarting the FAQbot. This is a service command that is not displayed in the chat window. Hotreload from file can be done by any user who knows this command.

/'categoryName' - show questions in groups. Groups are the categories assigned to the questions in the FAQ file.

Test Image 1

About

Are you being asked the same questions? Add answers to them in Telegram-FAQBot and it will answer for you.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors