help

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 10 Imported by: 0

README

plug-help

A Snart Plug which provides a basic help menu.

Documentation

Overview

Package help is a Snart plug which provides a basic help menu.

Index

Constants

This section is empty.

Variables

View Source
var (
	// NumCPU returns the number of processors on the system. Exported only for testing.
	NumCPU = runtime.NumCPU

	// TotalRAM returns the amount of RAM available on the system. Exported only for testing.
	TotalRAM = memory.TotalMemory

	// AllocRAM returns the amount of RAM allocated to the runtime. Exported only for testing.
	AllocRAM = func() uint64 {
		ms := runtime.MemStats{}
		runtime.ReadMemStats(&ms)

		return ms.Sys
	}
)
View Source
var Plug = plug.Plug(&Help{
	Startup: time.Now(),
})

Plug is a pre-allocated Help, to follow the same pattern as when loading using plugin.

Functions

This section is empty.

Types

type Help

type Help struct {
	plug.Base

	Startup time.Time
}

Help provides basic help and info menus.

func (*Help) About

func (h *Help) About(t *route.Trigger) error

About gives statistics about the given Bot.

func (*Help) Menu

func (h *Help) Menu(t *route.Trigger) error

Menu gives a help menu.

func (*Help) PlugRoute

func (h *Help) PlugRoute(r *route.Route)

PlugRoute adds the Help's Commands to the given Route.

func (*Help) String

func (h *Help) String() string
type MenuFlags struct {
	Help bool `default:"false" usage:"helpception"`
}

MenuFlags is flags for Menu.

Jump to

Keyboard shortcuts

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