models

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortOrderName    = SortOrder("name")
	SortOrderCreated = SortOrder("created")
)
View Source
const (
	EventSoundCreated       = "soundcreated"
	EventSoundUpdated       = "soundupdated"
	EventSoundDeleted       = "sounddeleted"
	EventVolumeUpdated      = "volumeupdated"
	EventGuildFilterUpdated = "guildfilterupdated"

	EventSenderController = "controller"
	EventSenderPlayer     = "player"
)

Variables

View Source
var (
	StatusOK      = StatusModel{Status: http.StatusOK, Message: "Ok"}
	StatusCreated = StatusModel{Status: http.StatusCreated, Message: "Created"}
)

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	ApiKey string `json:"api_key"`
}

type AuthLoginResponse

type AuthLoginResponse struct {
	AccessToken string    `json:"access_token"`
	Deadline    time.Time `json:"deadline"`
}

type Capabilities added in v1.5.0

type Capabilities []string

func (Capabilities) Add added in v1.5.0

func (t Capabilities) Add(cap string, enabled ...bool) Capabilities

type CreateSoundRequest

type CreateSoundRequest struct {
	Sound

	UploadId string     `json:"upload_id"`
	YouTube  *YouTubeDL `json:"youtube"`

	Normalize bool `json:"normalize"`
	Overdrive bool `json:"overdrive"`
}

type Event

type Event[T any] struct {
	Type    string `json:"type"`
	Origin  string `json:"origin,omitempty"`
	Payload T      `json:"payload,omitempty"`
}

func WrapErrorEvent

func WrapErrorEvent(err error, code ...int) Event[any]

type EventAuthPromptPayload

type EventAuthPromptPayload struct {
	Deadline  time.Time `json:"deadline"`
	TokenType string    `json:"token_type"`
}

type EventAuthRequest

type EventAuthRequest struct {
	Token string `json:"token"`
}

type EventErrorPayload

type EventErrorPayload struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type EventStatePayload

type EventStatePayload struct {
	EventVoiceJoinPayload

	Connected bool `json:"connected"`
	Joined    bool `json:"joined"`
	IsAdmin   bool `json:"is_admin"`
}

type EventType

type EventType struct {
	Type string `json:"type"`
}

type EventVoiceJoinPayload

type EventVoiceJoinPayload struct {
	Volume  int          `json:"volume,omitempty"`
	Filters GuildFilters `json:"filters,omitempty"`
	Guild   GuildInfo    `json:"guild,omitempty"`
}

type FastTrigger

type FastTrigger struct {
	FastTrigger string `json:"fast_trigger"`
}

type GuildFilters

type GuildFilters struct {
	Include []string `json:"include"`
	Exclude []string `json:"exclude"`
}

func (GuildFilters) Check

func (t GuildFilters) Check() error

func (*GuildFilters) Sanitize

func (t *GuildFilters) Sanitize()

type GuildInfo

type GuildInfo struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	IconUrl string `json:"icon_url"`
}

type ImportResult added in v1.4.0

type ImportResult struct {
	Successful []string           `json:"successful"`
	Failed     []SoundImportError `json:"failed"`
}

type OTAResponse

type OTAResponse struct {
	Deadline   time.Time `json:"deadline"`
	Token      string    `json:"token"`
	QRCodeData string    `json:"qrcode_data"`
}

type PlaybackLogEntry

type PlaybackLogEntry struct {
	Id        string    `json:"id"`
	Ident     string    `json:"ident"`
	GuildID   string    `json:"guild_id"`
	UserID    string    `json:"user_id"`
	Timestamp time.Time `json:"timestamp"`
}

type PlaybackStats

type PlaybackStats struct {
	Ident string `json:"ident"`
	Count int    `json:"count"`
}

type SetVolumeRequest

type SetVolumeRequest struct {
	Volume int `json:"volume"`
}

type SortOrder

type SortOrder string

type Sound

type Sound struct {
	Uid         string    `json:"uid"`
	DisplayName string    `json:"display_name"`
	Created     time.Time `json:"created_date"`
	Creator     UserSlim  `json:"creator"`
	Tags        []string  `json:"tags"`
}

func (Sound) Check

func (t Sound) Check() error

func (*Sound) Sanitize

func (t *Sound) Sanitize()

func (Sound) String

func (t Sound) String() string

type SoundImportError added in v1.4.0

type SoundImportError struct {
	Uid   string `json:"uid"`
	Error string `json:"error"`
}

type SoundUploadResponse

type SoundUploadResponse struct {
	UploadId string    `json:"upload_id"`
	Deadline time.Time `json:"deadline"`
}

type StateStats

type StateStats struct {
	NSoudns int `json:"n_sounds"`
	NPlays  int `json:"n_plays"`
}

type StatusModel

type StatusModel struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type StatusWithReservation added in v1.5.0

type StatusWithReservation struct {
	StatusModel
	Ratelimit ratelimit.Reservation `json:"ratelimit"`
}

type TwitchAPIState added in v1.5.0

type TwitchAPIState struct {
	Channel   string `json:"channel"`
	RateLimit struct {
		Burst        int `json:"burst"`
		ResetSeconds int `json:"reset_seconds"`
	} `json:"ratelimit"`
}

type TwitchSettings added in v1.5.0

type TwitchSettings struct {
	TwitchUserName string `json:"twitch_user_name"`
	Prefix         string `json:"prefix"`
	RateLimit      struct {
		Burst        int `json:"burst"`
		ResetSeconds int `json:"reset_seconds"`
	} `json:"ratelimit"`
	Filters   GuildFilters `json:"filters"`
	Blocklist []string     `json:"blocklist"`

	UserID string `json:"userid,omitempty"`
}

type TwitchState added in v1.5.0

type TwitchState struct {
	TwitchSettings

	Capable   bool `json:"capable"`
	Connected bool `json:"connected"`
}

type UpdateSoundRequest

type UpdateSoundRequest struct {
	Sound
}

type User

type User struct {
	discordgo.User

	AvatarURL string `json:"avatar_url"`
	IsOwner   bool   `json:"is_owner"`
}

func UserFromUser

func UserFromUser(u discordgo.User) User

type UserSlim added in v1.4.0

type UserSlim struct {
	ID            string `json:"id"`
	Username      string `json:"username,omitempty"`
	Discriminator string `json:"discriminator,omitempty"`
	AvatarURL     string `json:"avatar_url,omitempty"`
}

func UserSlimFromUser added in v1.4.0

func UserSlimFromUser(u discordgo.User) UserSlim

type YouTubeDL added in v1.3.0

type YouTubeDL struct {
	URL              string  `json:"url"`
	StartTimeSeconds float64 `json:"start_time_seconds"`
	EndTimeSeconds   float64 `json:"end_time_seconds"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL