interactions yay!!
This commit is contained in:
parent
b9a05bedf9
commit
f60033a3e4
30 changed files with 716 additions and 44 deletions
22
types/api_error.go
Normal file
22
types/api_error.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package types
|
||||
|
||||
import "github.com/gofiber/fiber/v3"
|
||||
|
||||
type APIError struct {
|
||||
StatusCode int `json:"-"`
|
||||
Message string `json:"message"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
func NewAPIError(code int, message string) APIError {
|
||||
return APIError{
|
||||
StatusCode: code,
|
||||
Message: message,
|
||||
Success: false,
|
||||
}
|
||||
}
|
||||
|
||||
func (a APIError) Send(c fiber.Ctx) error {
|
||||
c.JSON(a)
|
||||
return c.SendStatus(a.StatusCode)
|
||||
}
|
8
types/member.go
Normal file
8
types/member.go
Normal file
|
@ -0,0 +1,8 @@
|
|||
package types
|
||||
|
||||
type DiscordMember struct {
|
||||
User DiscordUser `json:"user"`
|
||||
Roles []string `json:"roles"`
|
||||
Permissions uint64 `json:"permissions"`
|
||||
Nick string `json:"nick"`
|
||||
}
|
7
types/user.go
Normal file
7
types/user.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package types
|
||||
|
||||
type DiscordUser struct {
|
||||
ID string `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Avatar string `json:"avatar"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue