twidiscord_module

package module
v0.0.0-...-1611a72 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = twid.Module{
	Name: "discord",
	New: func() twid.Handler {
		return NewEmptyHandler()
	},
}

Module is the twidiscord module.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler is the main handler that binds Twipi and Discord.

func NewEmptyHandler

func NewEmptyHandler() *Handler

NewEmptyHandler creates a new empty Handler. It is used to initialize its dependencies later.

func NewHandler

func NewHandler(twipisrv *twipi.ConfiguredServer, cfg twidiscord.Config) *Handler

NewHandler creates a new handler with the given twipi server and config.

func (*Handler) BindTwipi

func (h *Handler) BindTwipi(twipisrv *twipi.ConfiguredServer)

BindTwipi implements twid.TwipiBinder.

func (*Handler) Config

func (h *Handler) Config() any

Config returns the local configuration instance for this module. It implements twid.Handler.

func (*Handler) HTTPHandler

func (h *Handler) HTTPHandler() http.Handler

HTTPHandler implements twid.HTTPCommander.

func (*Handler) HTTPPrefix

func (h *Handler) HTTPPrefix() string

HTTPPrefix implements twid.HTTPCommander.

func (*Handler) HandleMessage

func (h *Handler) HandleMessage(ctx context.Context, msg twipi.Message)

HandleMessage implements twid.MessageHandler.

func (*Handler) Start

func (h *Handler) Start(ctx context.Context) error

Start connects all the accounts. It blocks until ctx is canceled.

Directories

Path Synopsis
web

Jump to

Keyboard shortcuts

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