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
  • Create room
  • Join room
  • Leave room
  • Invite user
  • Kick user
  • Send state event
  1. SDK Documentation
  2. Bot SDKs
  3. Golang Bot SDK

Room

Create room

func (cli *Client) CreateRoom(req *ReqCreateRoom) (resp *RespCreateRoom, err error)

Parameters:

Name
Type
Description
Required

req.Name

string

room name

false

req.RoomAliasName

string

room alias name

false

req.Topic

string

room topic

false

req.Invite

[]string

a list of user IDs to invite to the room

false

req.CreationContent

string

extra keys to be added to the content of the m.room.create event

false

Returns:

Name
Type
Description
Required

resp.RoomID

string

id for the created room

true

err

error

error message

true

Join room

func (cli *Client) JoinRoom(roomIDorAlias string) (resp *RespJoinRoom, err error)

Parameters:

Name
Type
Description
Required

roomIDorAlias

string

room id or alias

true

Returns:

Name
Type
Description
Required

resp.RoomID

string

id for the joined room

true

err

error

error message

true

Leave room

func (cli *Client) LeaveRoom(roomID string) (resp *RespLeaveRoom, err error)

Parameters:

Name
Type
Description
Required

roomID

string

room id

true

Returns:

Name
Type
Description
Required

resp

*RespLeaveRoom

empty response

true

err

error

error message

true

Invite user

func (cli *Client) InviteUser(roomID string, req *ReqInviteUser) (resp *RespInviteUser, err error)

Parameters:

Name
Type
Description
Required

roomID

string

room id

true

req.UserID

string

user id to invite

true

Returns:

Name
Type
Description
Required

resp

*ReqInviteUser

empty response

true

err

error

error message

true

Kick user

func (cli *Client) KickUser(roomID string, req *ReqKickUser) (resp *RespKickUser, err error)

Parameters:

Name
Type
Description
Required

roomID

string

room id

true

req.UserID

string

user id to kick

true

req.Reason

string

kick reason

true

Returns:

Name
Type
Description
Required

resp

*RespKickUser

empty response

true

err

error

error message

true

Send state event

func (cli *Client) SendStateEvent(roomID, eventType, stateKey string, contentJSON interface{}) (resp *RespSendEvent, err error)

Parameters:

Name
Type
Description
Required

roomID

string

room id

true

eventType

string

the type of event to send.

true

stateKey

string

the state_key for the state to send.

true

contentJSON

string

event content

true

Returns:

Name
Type
Description
Required

resp.EventID

string

id for the new event

true

err

error

error message

true

PreviousUserNextMessage

Last updated 1 year ago