calc

package
v0.0.0-...-f0c0f71 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Arguments = []*flags.Token{
	{
		Name:        "f",
		Short:       "f",
		Optional:    true,
		Description: "The number of decimal places to display the result.",
	},
	{
		Name:        "operation",
		Short:       "o",
		Default:     true,
		Description: "The operation to calculate.",
	},
}
View Source
var Command = &commands.WafferCommand{
	Plugin: &plugins.Plugin[*discordgo.MessageCreate]{
		Name:    "calc",
		Type:    plugins.MessageCreateType,
		Handler: Handler,
	},

	Data: &commands.CommandData{
		Name:         "calc",
		Description:  fmt.Sprintf("A mathematical calculation command. Ex: `%scalc --op (10 / 2) + 1`, `%scalc --f 4 --op (1 / 9)`. The `--f` flag sets how many decimal places to display the result. By default the command displays the first two decimal digits, but it also accepts: `0`, `1`, `2`, `3`, `4`, `5` and `6`.", env.Get("BOT_PREFIX"), env.Get("BOT_PREFIX")),
		Category:     "util",
		Arguments:    strings.Split(flags.GetUsages(Arguments...), "\n"),
		RequiredArgs: 1,
		Permissions: &commands.CommandPermissions{
			Require: discordgo.PermissionSendMessages,
			AllowDM: true,
		},
	},
}

Functions

func Handler

func Handler(s *discordgo.Session, m *discordgo.MessageCreate)

Types

This section is empty.

Jump to

Keyboard shortcuts

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