Documentation ¶
Index ¶
- Constants
- func ComponentParse(lines ...*ComponentLine) (result []discordgo.MessageComponent)
- func FindValue(interaction *discordgo.InteractionCreate, key string) (value []interface{})
- func GetUserVoiceState(discord *discordgo.Session, userID string) *discordgo.VoiceState
- func HaveRole(discord *discordgo.Session, guildID, userID, roleID string) (have bool, err error)
- func InteractionCommandCreate(discord *discordgo.Session, guildID string, ...)
- func InteractionCommandDelete(discord *discordgo.Session, guildID string, name string) error
- func JoinUserVCchannel(discord *discordgo.Session, userID string, micMute, speakerMute bool) (vc *discordgo.VoiceConnection, err error)
- func NewFileEncodeStream(v *discordgo.VoiceConnection, f string, opts EncodeOpts, done chan error) (s *encodeSession)
- func NewMemEncodeStream(v *discordgo.VoiceConnection, r io.Reader, opts EncodeOpts, done chan error) (s *encodeSession)
- func PlayAudioFile(vcSession *discordgo.VoiceConnection, filename string, speed float64, ...) error
- type ApplicationCommandOptions
- type ComponentLine
- type EncodeOpts
- type EncodeStats
- type InteractionData
- type InteractionResponse
- func (i *InteractionResponse) Edit(newData *discordgo.WebhookEdit) (*discordgo.Message, error)
- func (i *InteractionResponse) Follow(newData *discordgo.WebhookParams) (*discordgo.Message, error)
- func (i *InteractionResponse) Reply(resData *discordgo.InteractionResponseData) error
- func (i *InteractionResponse) Thinking(isInvisible bool) error
- func (i *InteractionResponse) Window(title, customID string, comps ...*ComponentLine) error
- type MessageData
- type ReactionData
- type VoiceStateData
- type VoiceStatus
Constants ¶
const Invisible uint64 = 1 << 6
InteractionResponseのFlag
Variables ¶
This section is empty.
Functions ¶
func ComponentParse ¶
func ComponentParse(lines ...*ComponentLine) (result []discordgo.MessageComponent)
Componentをdiscordgoで使えるように
func FindValue ¶
func FindValue(interaction *discordgo.InteractionCreate, key string) (value []interface{})
func GetUserVoiceState ¶
func GetUserVoiceState(discord *discordgo.Session, userID string) *discordgo.VoiceState
func InteractionCommandCreate ¶
func InteractionCommandCreate(discord *discordgo.Session, guildID string, commands []*discordgo.ApplicationCommand)
Command生成 all guild when guildID == ""
func InteractionCommandDelete ¶
Command削除 all guild when guildID == ""
func JoinUserVCchannel ¶
func NewFileEncodeStream ¶
func NewFileEncodeStream(v *discordgo.VoiceConnection, f string, opts EncodeOpts, done chan error) (s *encodeSession)
func NewMemEncodeStream ¶
func NewMemEncodeStream(v *discordgo.VoiceConnection, r io.Reader, opts EncodeOpts, done chan error) (s *encodeSession)
Types ¶
type ApplicationCommandOptions ¶
type ApplicationCommandOptions struct {
*discordgo.ApplicationCommandInteractionDataOption
}
func (ApplicationCommandOptions) AttachmentValue ¶
func (data ApplicationCommandOptions) AttachmentValue(i InteractionData) *discordgo.MessageAttachment
discordgo unsupported Attachments
type ComponentLine ¶
type ComponentLine struct {
// contains filtered or unexported fields
}
func ComponentNewLine ¶
func ComponentNewLine() *ComponentLine
func (*ComponentLine) Button ¶
func (cl *ComponentLine) Button(button discordgo.Button) *ComponentLine
if Style:5 => Request: URL unles Style:5 => Request: "CustomID" max 5 buttons in 1line Request: Label, Style.
func (*ComponentLine) Input ¶
func (cl *ComponentLine) Input(textInput discordgo.TextInput) *ComponentLine
FuncReq: AddLine() Request: CustomID,Label,Style. Styles : discordgo.TextInputShort,discordgo.TextInputParagraph,. Interaction Response Only
func (*ComponentLine) SelectMenu ¶
func (cl *ComponentLine) SelectMenu(selectMenu discordgo.SelectMenu) *ComponentLine
FuncReq: AddLine() Request: CustomID, Options. SelectMenuOption Request: Label,Value. if MinValue or MaxValue != 0 multi select
type EncodeOpts ¶
type EncodeOpts struct { FlameBuf int // default 100(20ms*100=2s) Offset float64 // encode start time AudioFilter string // ffmpeg Filters,https://ffmpeg.org/ffmpeg-filters.html#Audio-Filters Compression int //higher is best quality & slow encoding(0-10) }
FFmpeg Options
type EncodeStats ¶
type InteractionData ¶
type InteractionData struct { GuildID string Guild *discordgo.Guild ChannelID string Channel *discordgo.Channel User *discordgo.User InteractionType discordgo.InteractionType Command discordgo.ApplicationCommandInteractionData CommandOptions map[string]ApplicationCommandOptions Component discordgo.MessageComponentInteractionData Modal discordgo.ModalSubmitInteractionData ModalValues map[string]string FormatText string }
func InteractionParse ¶
func InteractionParse(discord *discordgo.Session, i *discordgo.Interaction) (id InteractionData)
type InteractionResponse ¶
type InteractionResponse struct { Response *discordgo.InteractionResponse // contains filtered or unexported fields }
func NewInteractionResponse ¶
func NewInteractionResponse(d *discordgo.Session, i *discordgo.Interaction) (ir *InteractionResponse)
func (*InteractionResponse) Edit ¶
func (i *InteractionResponse) Edit(newData *discordgo.WebhookEdit) (*discordgo.Message, error)
Interaction Edit Message
func (*InteractionResponse) Follow ¶
func (i *InteractionResponse) Follow(newData *discordgo.WebhookParams) (*discordgo.Message, error)
Interaction FollowUP Message Flags Usual: Invisible
func (*InteractionResponse) Reply ¶
func (i *InteractionResponse) Reply(resData *discordgo.InteractionResponseData) error
Interaction Reply Message Flags Usual: Invisible
func (*InteractionResponse) Thinking ¶
func (i *InteractionResponse) Thinking(isInvisible bool) error
Interaction Thinking Message Please after Follow()
func (*InteractionResponse) Window ¶
func (i *InteractionResponse) Window(title, customID string, comps ...*ComponentLine) error
Interaction Window Message Component only usual: Input#string
type MessageData ¶
type MessageData struct { GuildID string Guild *discordgo.Guild ChannelID string Channel *discordgo.Channel User *discordgo.User MessageID string Message *discordgo.Message FormatText string }
func MessageParse ¶
func MessageParse(discord *discordgo.Session, m *discordgo.Message) (md MessageData)
type ReactionData ¶
type ReactionData struct { GuildID string Guild *discordgo.Guild ChannelID string Channel *discordgo.Channel User *discordgo.User MessageID string Message *discordgo.Message Emoji discordgo.Emoji EmojiIcon string FormatText string }
func ReactionParse ¶
func ReactionParse(discord *discordgo.Session, r *discordgo.MessageReaction, eventName string) (rd ReactionData)
type VoiceStateData ¶
type VoiceStateData struct { GuildID string Guild *discordgo.Guild ChannelID string Channel *discordgo.Channel User *discordgo.User Status VoiceStatus UpdateStatus VoiceStatus FormatText string }
func VoiceStateParse ¶
func VoiceStateParse(discord *discordgo.Session, v *discordgo.VoiceStateUpdate) (vd VoiceStateData)