From b30a1fb7d2c4c595b9c1bee61d17c329cf2298c4 Mon Sep 17 00:00:00 2001 From: mavolin <48887425+mavolin@users.noreply.github.com> Date: Mon, 11 May 2020 05:24:12 +0200 Subject: [PATCH] Utils: add custom option types --- utils/json/option/custom.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 utils/json/option/custom.go diff --git a/utils/json/option/custom.go b/utils/json/option/custom.go new file mode 100644 index 0000000..7ab04c2 --- /dev/null +++ b/utils/json/option/custom.go @@ -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 }