SendingNetwork
  • OVERVIEW
    • Getting Started
    • FAQs
  • Network Instructional Articles
    • Basics
      • Introducing the Edge, WatchDog, and Guardian Nodes
      • Overview
      • Messaging Solution
      • Privacy Solution
      • Rich Communication Solution
      • Multi-Platform Solution
      • Decentralized Identity
      • Multiple Chat Modes
      • How It Works
      • Token Utility
      • The Team
    • Key Concepts
      • Decentralized Identity
      • Social Graphs
      • Edge Node
  • SDK Documentation
    • Glossary
    • JavaScript client SDK
      • DID
      • User
      • Message
      • Room
      • Contact
      • Social Graph
    • iOS client SDK
      • Push
      • DID
      • User
      • Message
      • Room
      • Contact
    • Android client SDK
      • User
      • Room
    • Java SDK
      • DID
      • Room
      • Message
    • Node.js SDK
      • DID
      • Room
      • Message
    • Unreal SDK
      • DID
      • User
      • Message
      • Room
    • Unity SDK
      • DID
      • Room
      • Message
    • Website chat widget SDK
      • Customization
      • DID
      • User
      • Room
      • Message
      • Other
    • Bot SDKs
      • Golang Bot SDK
        • DID
        • User
        • Room
        • Message
    • Extensible Message Interface
    • Push Notifications
    • Flutter SDK
      • DID
      • User
      • Message
      • Room
    • PHP SDK
      • DID
      • Room
      • User
    • Developer Key
  • Acquisition Kit
    • Social Boost Development Instructions
  • WatchDog Agent
    • WatchDog Agent Guide
    • WatchDog Agent Deployment Tutorial
      • Linux Deployment Tutorial
    • One-Click Deployment
  • Edge Node
    • Edge Node Deployment Tutorial
    • VPS Setup Guide
      • Google Cloud Platform (GCP)
      • Amazon Web Services (AWS)
      • Contabo
    • Check Node Stats with Auto-Reply Bot in SendingMe App
    • Alpha-3 Testnet FAQs
  • delegation node
    • Delegation Node Deployment Tutorial
  • Private Delegation Node
  • Use Cases
    • Wallet-to-Wallet Messaging
    • Dapp Notifications
    • Identity Verification
    • Gamer Acquisition
    • Cross-platform Trading
Powered by GitBook
On this page
  • Install
  • Usage
  • Examples
  • License
  1. SDK Documentation
  2. Bot SDKs

Golang Bot SDK

A Golang server-side Bot SDK

This Bot SDK enables developers to create chatbots for managing chat groups. You can develop a bot capable of managing group chats using various standards, such as token-gated chats which can be useful for managing exclusive or private groups.

Create custom chatbots tailored to your needs and add them seamlessly to the existing chat groups. This can save time and effort, as well as improve the efficiency and effectiveness of chat group management.

Install

go get github.com/sending-network/sendingnetwork-bot

Usage

Prepare a configuration file

Please contact developer@sending.network for a test P2P node URL.

Provide P2P node endpoint, wallet address and private key in config.yaml:

endpoint: ""
wallet_address: ""
private_key: ""

You can use an existing wallet account, or generate a new account by running:

go run tools/generate_wallet_account.go

Create an instance of Client

After reading the configuration file, create an instance of Client

package main
​
import (
  "os"
  
  sdnclient "github.com/sending-network/sendingnetwork-bot"
  "gopkg.in/yaml.v3"
)
​
func main() {
    configData, _ := os.ReadFile("config.yaml")
    config := sdnclient.Config{}
    _ = yaml.Unmarshal(configData, &config)
    cli, _ := sdnclient.NewClient(&config)
}

Call API functions

// create new room
respCreateRoom, _ := cli.CreateRoom(&sdnclient.ReqCreateRoom{
  Name:   "TestRoom",
})
​
// invite user to the room
respInviteUser, _ := cli.InviteUser(respCreateRoom.RoomID, &sdnclient.ReqInviteUser{
    UserID: userID,
})
​
// logout to invalidate access token
respLogout, _ := cli.Logout()

Examples

You can see more use cases in the examples directory.

License

Apache 2.0

PreviousBot SDKsNextDID

Last updated 1 year ago