bacotell_plugin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: GPL-3.0 Imports: 6 Imported by: 3

Documentation

Overview

Package bacotell_plugin provides the plugin entrypoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(id, token string) (hclog.Logger, <-chan struct{}, error)

Debug starts the plugin in debug mode with the provided id, bot token and a default plugin implementation.

In debug mode a BacoTell instance is started within the plugin process so that the plugin can be executed directly. This allows for easy debugging within an IDE. The embedded BacoTell only loads the current plugin.

Before calling this all commands, component, etc. that should be provided by the plugin must be set using the functions SetApplicationCommands, SetMessageComponents, etc. The returned logger should be used by the plugin code to log messages to stdout/stderr. Because this function does not wait for the plugin to terminate again, the returned channel should be used to block until it gets closed, signaling a exit.

func DebugCustom

func DebugCustom(customPlugin common.Plugin, token string) (hclog.Logger, <-chan struct{}, error)

DebugCustom starts the plugin in debug mode with the provided id, bot token and custom plugin implementation.

In debug mode a BacoTell instance is started within the plugin process so that the plugin can be executed directly. This allows for easy debugging within an IDE. The embedded BacoTell only loads the current plugin.

The returned logger should be used by the plugin code to log messages to stdout/stderr. Because this function does not wait for the plugin to terminate again, the returned channel should be used to block until it gets closed, signaling a exit.

func Run

func Run(id string) (hclog.Logger, <-chan struct{}, error)

Run starts the plugin with the provided id and a default plugin implementation.

Before calling this all commands, component, etc. that should be provided by the plugin must be set using the functions SetApplicationCommands, SetMessageComponents, etc. The returned logger should be used by the plugin code to log messages to stdout/stderr. Because this function does not wait for the plugin to terminate again, the returned channel should be used to block until it gets closed, signaling a exit.

func RunCustom

func RunCustom(customPlugin common.Plugin) (hclog.Logger, <-chan struct{}, error)

RunCustom starts the plugin with the provided id and custom plugin implementation.

The returned logger should be used by the plugin code to log messages to stdout/stderr. Because this function does not wait for the plugin to terminate again, the returned channel should be used to block until it gets closed, signaling a exit.

func SetApplicationCommands

func SetApplicationCommands(commands ...common.Command)

SetApplicationCommands sets the commands provided by the current plugin.

func SetMessageComponents

func SetMessageComponents(components ...common.Component)

SetMessageComponents sets the components provided by the current plugin.

func SetModals

func SetModals(modals ...common.Modal)

SetModals sets the modals provided by the current plugin.

Types

This section is empty.

Jump to

Keyboard shortcuts

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