Skip to content

IceeMC/bread-tags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bread-tags

bread-tags is a minimal, customizable, fast tas parser for discord bots.

Installation

go get https://github.com/IceeMC/bread-tags

Usage

// This code assumes you have defined it in a main/similar function
context := make(map[string]interface{})
context["args"] = []string{"Ice"}
breadtags.Parse("Hi, {args}", context) // Hi, Ice

Creating custom tags

// Create the tag
tag := &breadtags.Tag{
	Name: "mytag",
	Run: func (value string, context map[string]interface{}) string {
		// What to do when the tag is ran
		return value
	}
}
breadtags.LoadTags(tag)
// Using the tag
breadtags.Parse("{mytag:Some value}", nil) // Some value

About

A port of the the original bread-tags to golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages