chatbot

package
v0.0.0-...-dbdf344 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: BSD-3-Clause Imports: 11 Imported by: 5

Documentation

Overview

chatbot is a package for creating chatbots that interact via webhooks.

Index

Constants

View Source
const (
	BOT_WEBHOOK_METADATA_KEY = "bot_webhooks"
)

Variables

This section is empty.

Functions

func Init

func Init(name string)

func Send

func Send(body, room, thread string) error

Send the 'body' as a message to the given chat 'room' name.

func SendUsingConfig

func SendUsingConfig(body, room, thread string, configReader ConfigReader) error

SendUsingConfig is just like Send(), but the config retrieved is provided by the configReader.

Types

type ConfigReader

type ConfigReader func() string

ConfigReader is a func that returns the config for SendUsingConfig.

type Message

type Message struct {
	Name   string `json:"name"`
	Text   string `json:"text"`
	Sender Sender `json:"sender"`
}

type Sender

type Sender struct {
	DisplayName string `json:"displayName"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL