module

package
v0.0.0-...-4e18fe8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package module provides implementations for the module abstractions found in package plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalizedMeta

type LocalizedMeta struct {
	// Name is the name of the module.
	// It may not contain whitespace or dots.
	Name string
	// ShortDescription is an optional short description of the module.
	ShortDescription *i18n.Config
	// LongDescription is an optional long description of the module.
	LongDescription *i18n.Config
}

LocalizedMeta is the localized, implementation of the plugin.ModuleMeta interface.

func (LocalizedMeta) GetLongDescription

func (m LocalizedMeta) GetLongDescription(l *i18n.Localizer) string

func (LocalizedMeta) GetName

func (m LocalizedMeta) GetName() string

func (LocalizedMeta) GetShortDescription

func (m LocalizedMeta) GetShortDescription(l *i18n.Localizer) string

type Meta

type Meta struct {
	// Name is the name of the module.
	// It may not contain whitespace or dots.
	Name string
	// ShortDescription is an optional short description of the module.
	ShortDescription string
	// LongDescription is an optional long description of the module.
	LongDescription string
}

Meta is the static, unlocalized, implementation of the plugin.ModuleMeta interface.

func (Meta) GetLongDescription

func (m Meta) GetLongDescription(*i18n.Localizer) string

func (Meta) GetName

func (m Meta) GetName() string

func (Meta) GetShortDescription

func (m Meta) GetShortDescription(*i18n.Localizer) string

type Module

type Module struct {
	plugin.ModuleMeta
	*bot.MiddlewareManager
	// contains filtered or unexported fields
}

Module is an implementation of plugin.Module with support for middlewares.

func New

func New(meta plugin.ModuleMeta) *Module

New creates a new *Module using the passed plugin.ModuleMeta.

func (*Module) AddCommand

func (m *Module) AddCommand(cmd plugin.Command)

AddCommand adds the passed command to the module.

func (*Module) AddModule

func (m *Module) AddModule(mod plugin.Module)

AddModule adds the passed module to the module.

func (*Module) GetCommands

func (m *Module) GetCommands() []plugin.Command

func (*Module) GetModules

func (m *Module) GetModules() []plugin.Module

Jump to

Keyboard shortcuts

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