util

package
v0.0.0-...-6c10439 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const QUEUE_BACKWARDS_CID = "queue_backwards"
View Source
const QUEUE_FORWARDS_CID = "queue_forwards"
View Source
const QUEUE_PAUSE_CID = "queue_pause"
View Source
const QUEUE_RESUME_CID = "queue_resume"
View Source
const QUEUE_SKIPTO_CID = "queue_skipto"
View Source
const QUEUE_SKIPTO_MODAL_CID = "queue_skipto_modal"
View Source
const QUEUE_SKIPTO_MODAL_TEXT_CID = "queue_skipto_modal_text"
View Source
const QUEUE_SKIP_CID = "queue_skip"
View Source
const QUEUE_STOP_CID = "queue_stop"

Variables

This section is empty.

Functions

func ActionRowComps

func ActionRowComps(buttonLabels, buttonsIDs []string) *[]discordgo.MessageComponent

func CreatePionRTPPacket

func CreatePionRTPPacket(p *discordgo.Packet) *rtp.Packet

func FormatSeconds

func FormatSeconds(seconds uint32) string

func QueueButtonsCustomIDs

func QueueButtonsCustomIDs() []string

func VoiceChannel

func VoiceChannel(g *discordgo.Guild, authorID string) (string, bool)

Types

type InteractionContext

type InteractionContext struct {
	Session     *discordgo.Session
	Interaction *discordgo.InteractionCreate
}

func (*InteractionContext) ButtonInteractionAnswer

func (ic *InteractionContext) ButtonInteractionAnswer(message string, buttonLabels, buttonsIDs []string) error

use this function if you need some simple buttons in your answer there can be only 5 buttons in a row, this function takes care of this and adds new rows if needed

func (*InteractionContext) DefaulInteractionAnswer

func (ic *InteractionContext) DefaulInteractionAnswer(message string) error

func (*InteractionContext) DeferAnswer

func (ic *InteractionContext) DeferAnswer() error

send this if your real answer to the interaction can potentially time out (3s)

func (*InteractionContext) GeneralInteractionAnswer

func (ic *InteractionContext) GeneralInteractionAnswer(data *discordgo.InteractionResponseData) error

func (*InteractionContext) GetResponse

func (ic *InteractionContext) GetResponse() (*discordgo.Message, error)

func (*InteractionContext) NoAnswer

func (ic *InteractionContext) NoAnswer() error

func (*InteractionContext) UpdateAnswer

func (ic *InteractionContext) UpdateAnswer(message string) error

if you deferred your answer before use this to update your answer

func (*InteractionContext) UpdateAnswerComplex

func (ic *InteractionContext) UpdateAnswerComplex(messageEdit *discordgo.WebhookEdit) error

func (*InteractionContext) UpdateMessageComplex

func (ic *InteractionContext) UpdateMessageComplex(messageEdit *discordgo.MessageEdit) error

type PlayInfo

type PlayInfo struct {
	Name   string //Name to display for play in queue
	Length uint32 //Length of play in seconds
}

func (PlayInfo) String

func (p PlayInfo) String() string

String representation of a PlayInfo

type SoundPlayer

type SoundPlayer interface {
	// needs to return on closing the first channel, optionally on the second
	Play(sendChan chan []byte, done chan struct{}, stop chan struct{}, pause chan bool, resume chan bool) error
}

Jump to

Keyboard shortcuts

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