From cd73fbb079520ef47f0ebe629a7a09e2fe976d57 Mon Sep 17 00:00:00 2001 From: 5elenay <5elenay@protonmail.com> Date: Wed, 8 Sep 2021 17:00:13 +0300 Subject: [PATCH] added edit bot struct. --- other.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/other.go b/other.go index 70988be..878fd32 100644 --- a/other.go +++ b/other.go @@ -279,3 +279,36 @@ type Binary struct { func (b Binary) Save(path string) error { return os.WriteFile(path, b.Data, 0666) } + +// Edit bot struct +// Please see https://developers.revolt.chat/api/#tag/Bots/paths/~1bots~1:bot/patch for more information. +type EditBot struct { + Name string `json:"name,omitempty"` + Public bool `json:"public,omitempty"` + InteractionsUrl string `json:"interactionsURL,omitempty"` + Remove string `json:"remove,omitempty"` +} + +// Set name for struct. +func (eb *EditBot) SetName(name string) *EditBot { + eb.Name = name + return eb +} + +// Set public value for struct. +func (eb *EditBot) SetPublicValue(is_public bool) *EditBot { + eb.Public = is_public + return eb +} + +// Set interaction url for struct. +func (eb *EditBot) SetInteractionsUrl(url string) *EditBot { + eb.InteractionsUrl = url + return eb +} + +// Remove interaction url for struct. +func (eb *EditBot) RemoveInteractionsUrl() *EditBot { + eb.Remove = "InteractionsURL" + return eb +}