From a4bc77120d310517261f7ef5b932664580b86afd Mon Sep 17 00:00:00 2001 From: 5elenay <5elenay@protonmail.com> Date: Mon, 30 Aug 2021 10:51:30 +0300 Subject: [PATCH] added binary struct. --- other.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/other.go b/other.go index 0bb0505..7f8af33 100644 --- a/other.go +++ b/other.go @@ -1,6 +1,9 @@ package revoltgo -import "fmt" +import ( + "fmt" + "os" +) // Similar to message, but created for send message function. type SendMessage struct { @@ -266,3 +269,13 @@ func (eu *EditUser) SetRemove(item string) *EditUser { eu.Remove = item return eu } + +// Revoltgo binary struct. +type Binary struct { + Data []byte +} + +// Save data to the given path. +func (b Binary) Save(path string) error { + return os.WriteFile(path, b.Data, 0666) +}