Utils: add custom option types

This commit is contained in:
mavolin 2020-05-11 05:24:12 +02:00
parent a29a521c5a
commit b30a1fb7d2
No known key found for this signature in database
GPG Key ID: D8681218EDF216DF
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package option
import "github.com/diamondburned/arikawa/discord"
// ================================ Seconds ================================
// Seconds is the option type for discord.Seconds.
type Seconds *discord.Seconds
// ZeroSeconds are 0 Seconds.
var ZeroSeconds = NewSeconds(0)
// NewString creates a new Seconds with the value of the passed discord.Seconds.
func NewSeconds(s discord.Seconds) Seconds { return &s }
// ================================ Color ================================
// Color is the option type for discord.Color.
type Color *discord.Color
// NewString creates a new Color with the value of the passed discord.Color.
func NewColor(s discord.Color) Color { return &s }