cmd

package
v0.0.0-...-bbf8f27 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommandMap = make(map[string]Command)

Functions

func CodeBlock

func CodeBlock(lang string, s string) string

func ErrorResponse

func ErrorResponse(err error) *api.InteractionResponseData

func RegisterCommand

func RegisterCommand(command Command)

func Response

func Response(format string, a ...any) *api.InteractionResponseData

Types

type Command

type Command struct {
	Name           string
	Guilds         []discord.GuildID
	DiscordData    api.CreateCommandData
	DiscordHandler cmdroute.CommandHandlerFunc
}

type RedditCacheEntry

type RedditCacheEntry struct {
	// contains filtered or unexported fields
}

type RedditData

type RedditData struct {
	After   string       `json:"after"`
	Dist    int          `json:"dist"`
	ModHash string       `json:"modhash"`
	Posts   []RedditPost `json:"children"`
}

type RedditMedia

type RedditMedia struct {
	RedditVideo RedditVideo `json:"reddit_video"`
}

type RedditMediaMetadata

type RedditMediaMetadata struct {
	Type     string `json:"e"`
	MimeType string `json:"m"`
	ID       string `json:"id"`
}

type RedditPost

type RedditPost struct {
	Kind string         `json:"kind"`
	Data RedditPostData `json:"data"`
}

type RedditPostData

type RedditPostData struct {
	ID            string                         `json:"id"`
	Subreddit     string                         `json:"subreddit"`
	Title         string                         `json:"title"`
	Selftext      string                         `json:"selftext"`
	Author        string                         `json:"author"`
	MediaMetadata map[string]RedditMediaMetadata `json:"media_metadata"`
	Media         RedditMedia                    `json:"media"`
	Created       float64                        `json:"created"`
	Score         int                            `json:"score"`
	Comments      int                            `json:"num_comments"`
	DirectURL     string                         `json:"url_overridden_by_dest"`
	Gallery       bool                           `json:"is_gallery"`
	NSFW          bool                           `json:"over_18"`
	Stickied      bool                           `json:"stickied"`
}

type RedditResponse

type RedditResponse struct {
	Kind    string     `json:"kind"`
	Data    RedditData `json:"data"`
	Message string     `json:"message"`
	Error   int        `json:"error"`
}

type RedditVideo

type RedditVideo struct {
	BitrateKbps       int    `json:"bitrate_kbps"`
	DashURL           string `json:"dash_url"`
	Duration          int    `json:"duration"`
	FallbackURL       string `json:"fallback_url"`
	HasAudio          bool   `json:"has_audio"`
	Height            int    `json:"height"`
	HlsURL            string `json:"hls_url"`
	IsGif             bool   `json:"is_gif"`
	ScrubberMediaURL  string `json:"scrubber_media_url"`
	TranscodingStatus string `json:"transcoding_status"`
	Width             int    `json:"width"`
}

Jump to

Keyboard shortcuts

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