Documentation ¶
Index ¶
- Constants
- func CommandDelete(discord *discordgo.Session, guildID string, name string) error
- func FindValue(interaction *discordgo.InteractionCreate, key string) (value []interface{})
- type Command
- func (c *Command) AddChoice(name string, value interface{}) *Command
- func (c *Command) AddCommand(cmd, description string, perm int64) *Command
- func (c *Command) AddOption(ops *discordgo.ApplicationCommandOption) *Command
- func (c *Command) CommandCreate(discord *discordgo.Session, guildID string)
- func (c *Command) CommandLast() int
- func (c *Command) OptionsLast() int
- type CommandType
- type Component
- func (c *Component) AddButton(data discordgo.Button) *Component
- func (c *Component) AddInput(data discordgo.TextInput) *Component
- func (c *Component) AddLine() *Component
- func (c *Component) AddSelectMenu(data discordgo.SelectMenu) *Component
- func (c *Component) CompArrayLast(n int) int
- func (c *Component) Parse() (result []discordgo.MessageComponent)
- 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(invisible bool) error
- func (i *InteractionResponse) Window(title, customID string, comp *Component) error
- type InteractionStruct
- type OptionData
- type OptionType
- type PostData
- type ReturnType
Constants ¶
const Invisible uint64 = 1 << 6
InteractionResponseのFlag
Variables ¶
This section is empty.
Functions ¶
func CommandDelete ¶
Command削除 all guild when guildID == ""
func FindValue ¶
func FindValue(interaction *discordgo.InteractionCreate, key string) (value []interface{})
Types ¶
type Command ¶
type Command struct { Discord []*discordgo.ApplicationCommand // contains filtered or unexported fields }
チェーンメゾット用の型
func (*Command) AddCommand ¶
コマンド生成 perm is command run user permission by https://github.com/bwmarrin/discordgo/blob/v0.27.1/structs.go#L2092-L2179
func (*Command) AddOption ¶
func (c *Command) AddOption(ops *discordgo.ApplicationCommandOption) *Command
コマンドのオプションの追加 how to use Minvalue,MinLength x :=1.1 ops.MinValue = &x
func (*Command) CommandCreate ¶
Command生成 all guild when guildID == ""
type CommandType ¶
type CommandType int8
返すタイプ
const ( // Slash Command (MessageCommand) SlashCommand CommandType = 1 // Comporment Command (MessageComponent) ComponentCommand CommandType = 2 // Submit (ModalSubmit) SubmitCommand CommandType = 3 )
type Component ¶
type Component struct {
Discord []discordgo.ActionsRow
}
チェーンメゾット用の型
func (*Component) AddButton ¶
ボタンの追加 Request: Label, Style. if Style:5 => Request: URL unles Style:5 => Request: "CustomID" max 5 buttons in 1line
func (*Component) AddInput ¶
入力の追加 FuncReq: AddLine() Request: CustomID,Label,Style. Styles : discordgo.TextInputShort,discordgo.TextInputParagraph,. Interaction Response Only
func (*Component) AddSelectMenu ¶
func (c *Component) AddSelectMenu(data discordgo.SelectMenu) *Component
選択メニューの追加 FuncReq: AddLine() Request: CustomID, Options. SelectMenuOption Request: Label,Value. if MinValue or MaxValue != 0 multi select
func (*Component) Parse ¶
func (c *Component) Parse() (result []discordgo.MessageComponent)
Componentをdiscordgoで使えるように
type InteractionResponse ¶
type InteractionResponse struct { Discord *discordgo.Session Interaction *discordgo.Interaction Response *discordgo.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(invisible bool) error
Interaction Thinking Message Please after Follow()
type InteractionStruct ¶
type InteractionStruct struct { GuildID string GuildName string GuildData *discordgo.Guild ChannelID string ChannelName string ChannelData *discordgo.Channel UserID string UserNum string UserName string UserData *discordgo.User Type discordgo.InteractionType Check CommandType Command discordgo.ApplicationCommandInteractionData CommandOptions map[string]OptionData Component discordgo.MessageComponentInteractionData Submit discordgo.ModalSubmitInteractionData PostData []PostData FormatText string }
整形用構造体
func InteractionViewAndEdit ¶
func InteractionViewAndEdit(discord *discordgo.Session, i *discordgo.InteractionCreate) (iData InteractionStruct)
InteractionCreate 整形
type OptionData ¶
type OptionData struct {
*discordgo.ApplicationCommandInteractionDataOption
}
SlashCommandのOptionデータ
func (OptionData) AttachmentValue ¶
func (data OptionData) AttachmentValue(i InteractionStruct) *discordgo.MessageAttachment
discordgoにないデータ
type OptionType ¶
type OptionType int8
Optionタイプ
const ( // String TypeString OptionType = 3 // Int TypeInt OptionType = 4 // Bool TypeBool OptionType = 5 // @User TypeUser OptionType = 6 // #Channnel TypeChannel OptionType = 7 // @Role TypeRole OptionType = 8 // Mentionable (@User,@Role) TypeMention OptionType = 9 // Float TypeFloat OptionType = 10 // Files TypeFile OptionType = 11 )
type ReturnType ¶
type ReturnType int8
返すタイプ
const ( // Reply for Message ReplyMessage ReturnType = 4 // Reply for Thiking // pls leter Edit() ReplyThiking ReturnType = 5 // Interaction In Modal Window Window ReturnType = 9 )