prefix

package
v0.0.0-...-96179aa Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UrrAdmin           = core.UrrNew("prefixes of type 'admin' are static, change the bot's config instead")
	UrrMoreThanOneType = core.UrrNew("only one type per prefix allowed")
)
View Source
var (
	UrrExists   = core.UrrNew("The prefix already exists.")
	UrrNotFound = core.UrrNew("The prefix was not found.")
	UrrOneLeft  = core.UrrNew("Only one prefix is left.")

	UrrCustomCommandExists = core.UrrNew("Can't add the prefix %s. A custom command with the name %s exists and would collide with the built-in command of the same name. Either change the custom command or use a different prefix.")
)
View Source
var Admin = admin{}
View Source
var AdminAdd = adminAdd{}
View Source
var AdminDelete = adminDelete{}
View Source
var AdminList = adminList{}
View Source
var AdminReset = adminReset{}
View Source
var Advanced = advanced{}
View Source
var AdvancedAdd = advancedAdd{}
View Source
var AdvancedDelete = advancedDelete{}
View Source
var AdvancedList = advancedList{}
View Source
var AdvancedReset = advancedReset{}
View Source
var Normal = normal{}
View Source
var NormalAdd = normalAdd{}
View Source
var NormalDelete = normalDelete{}
View Source
var NormalReset = normalReset{}

Functions

func Add

func Add(prefix string, t core.CommandType, place int64) (string, core.Urr, error)

Add adds a prefix of type t in the specified place. If the prefix, regardless of type, already exists then returns an UrrExists error. If a custom command happens to collide with the newly added prefix (for example if the custom command `.help` exists and the prefix `.` is added then `.help` would collide with the built-in command `help`) then returns an UrrCustomCommandExists error.

func Delete

func Delete(prefix string, t core.CommandType, place int64) (core.Urr, error)

Delete removes the prefix of type t from the specified place. If the prefix doesn't exist returns an UrrNotFound error. If there is only one prefix of that type left then returns an UrrOneLeft error.

func List

func List(t core.CommandType, place int64) ([]core.Prefix, error)

List returns a list of prefixes with type t in the specified place. It is possible to return prefixes of multiple types like so:

List(core.Normal|core.Advanced, place)

func Reset

func Reset(place int64) error

Reset wipes all the prefixes from the database making it so the default ones will have to be used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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