Docs QSoft
CXPerium Bot C#
CXPerium Bot C#
  • Özet
  • Appsettings
  • Source Code
    • File Structure
    • Building Blocks
      • Contact
      • Activity
      • Conversation
    • Services
      • Whatsapp Message
        • SendMessage
        • SendMessageWithButton
        • SendLocationMessage
        • SendLocationRequest
        • SendSurvey
        • SendSticker
        • SendMediaWithUrl
        • SendMessageWithFlow
      • Cxperium
      • Automate
        • Page 1
  • Başlarken
    • Gereksinimler
    • CXPerium Hesabı Oluşturma
    • Bot Projesini Klonlama
    • Nuget Paketleri
    • Tunnel Setup
    • Integration with Bot
      • Developer Settings
  • Hello World!
  • Project Structure
    • Channels
      • Whatsapp.cs
      • CXPerium.cs
    • Dialogs
  • Library
    • Objects
      • Activity
      • Conversation
      • Contact
    • Messages
  • Assistan Modules
    • Configuration
    • Intent
    • Localization
  • WebHook
  • Gelişmiş Özellikler
    • Using Flows
    • Using Catalogs
    • Logging & Debug
  • WhatsApp Cloud API & Cxperium Integration
  • Değişiklik Günlüğü
Powered by GitBook
On this page

Hello World!

Your first Hello World example.

PreviousDeveloper SettingsNextProject Structure

Last updated 9 months ago

After creating a Welcome dialog class in your sample project, if appsettings.json file is implemented, and intent is created correctly, you should send a message with your WhatsApp Phone Number, and receive a text message Hello World!.

Whatsapp.cs file is basically the entry point of the project. When a message is sent, your first point of contact is the GetContactByPhone in Whatsapp.cs file. Once you initialize your needs in that method, the message sent by the user will be processed, and if matched with the intent, RunDialog() method of your Welcome class will be executed.

using CXPerium.Dialogs.WhatsApp;
using CXPerium.Models;
using CXPerium.WhatsApp;

namespace CXPerium.Bot.Sample.Dialogs
{
    public class WelcomeDialog : BaseWhatsAppDialog, IWhatsAppDialog
    {
        public WelcomeDialog(Models.Contact contact, Activity activity, ConversationState conversation)
            : base(contact, activity, conversation) { }

        public void RunDialog()
        {
            SendMessage("Hello World!");
        }
    }
}

When you provide the correct intent as it is shown above, the bot's response will be Hello World!

Hello World!
Hello World Whatsapp