discord

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package discord implements the ChatBot interface using discord as the underlying chat service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.1.8

func New(executor action.Executor, s store.Store) (*discord, error)

New instantiates a new, unconnected, discord instance

func RespErr added in v0.1.8

func RespErr(r *botResponse, m string)

RespErr creates a common error message embed

func RespOk added in v0.1.8

func RespOk(r *botResponse, title string) *discordgo.MessageEmbed

RespOk will set up and allocate a base successful response embed that can be further customized

Types

type ChatBot added in v0.1.8

type ChatBot interface {
	Start(ctx context.Context, token string, eventChan chan model.ServerEvent) error
	Send(channelId string, message string, wrap bool) error
	SendEmbed(channelId string, message *discordgo.MessageEmbed) error
}

ChatBot defines a interface for communication with 3rd party service bots Currently this is only used for discord, but other providers such as Guilded, Matrix, IRC, etc. are planned. TODO decouple embed's from discordgo

Jump to

Keyboard shortcuts

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