Documentation ¶
Index ¶
- Constants
- type BotClient
- func (botClient *BotClient) GetChannelClient(channelId discord.Snowflake) *ChannelClient
- func (botClient *BotClient) GetGuildClient(guildId discord.Snowflake) *GuildClient
- func (botClient *BotClient) GetSelfUserClient() *UserClient
- func (botClient *BotClient) GetUserClient(userId discord.Snowflake) *UserClient
- func (botClient *BotClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
- type ChannelClient
- type DiscordRequest
- type GuildClient
- type MemberClient
- type ModifyMemberRoleOpts
- type SendMessageData
- type UserClient
- func (userClient *UserClient) CreateDMChannel() (*discord.Channel, error)
- func (userClient *UserClient) GetIdAsString() string
- func (userClient *UserClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
- func (userClient *UserClient) SendMessage(messageData SendMessageData) (*discord.Message, error)
Constants ¶
View Source
const (
DiscordApiURL = "https://discord.com/api"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BotClient ¶
func (*BotClient) GetChannelClient ¶ added in v0.2.1
func (botClient *BotClient) GetChannelClient(channelId discord.Snowflake) *ChannelClient
func (*BotClient) GetGuildClient ¶
func (botClient *BotClient) GetGuildClient(guildId discord.Snowflake) *GuildClient
func (*BotClient) GetSelfUserClient ¶ added in v0.2.1
func (botClient *BotClient) GetSelfUserClient() *UserClient
func (*BotClient) GetUserClient ¶ added in v0.2.1
func (botClient *BotClient) GetUserClient(userId discord.Snowflake) *UserClient
func (*BotClient) MakeRequest ¶
func (botClient *BotClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
type ChannelClient ¶ added in v0.2.1
func (*ChannelClient) MakeRequest ¶ added in v0.2.1
func (channelClient *ChannelClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
func (*ChannelClient) SendMessage ¶ added in v0.2.1
func (channelClient *ChannelClient) SendMessage(messageData SendMessageData) (*discord.Message, error)
type DiscordRequest ¶
type DiscordRequest struct { ExpectedStatus int Method string Endpoint string Body []byte UnmarshalTo interface{} DisableAuth bool DisableStatusCheck bool AdditionalHeaders map[string]string }
func (*DiscordRequest) GetUrl ¶
func (discordRequest *DiscordRequest) GetUrl() string
func (*DiscordRequest) ValidateEndpoint ¶
func (discordRequest *DiscordRequest) ValidateEndpoint()
type GuildClient ¶
func (*GuildClient) FetchGuild ¶ added in v0.2.5
func (guildClient *GuildClient) FetchGuild() (*discord.Guild, error)
func (*GuildClient) GetMemberClient ¶
func (guildClient *GuildClient) GetMemberClient(memberId discord.Snowflake) *MemberClient
func (*GuildClient) MakeRequest ¶
func (guildClient *GuildClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
type MemberClient ¶
type MemberClient struct { MemberId discord.Snowflake GuildClient *GuildClient }
func (*MemberClient) AddRoleToMember ¶
func (memberClient *MemberClient) AddRoleToMember(opts ModifyMemberRoleOpts) error
func (*MemberClient) FetchMember ¶
func (memberClient *MemberClient) FetchMember() (*discord.Member, error)
func (*MemberClient) MakeRequest ¶
func (memberClient *MemberClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
type ModifyMemberRoleOpts ¶
type SendMessageData ¶ added in v0.2.1
type SendMessageData struct { Content *string `json:"content,omitempty"` TTS *bool `json:"tts,omitempty"` Embeds []discord.Embed `json:"embeds,omitempty"` AllowedMentions *discord.AllowedMentions `json:"allowed_mentions,omitempty"` // Channel ID optional MessageReference *discord.MessageReference `json:"message_reference,omitempty"` Components []components.MessageComponent `json:"components,omitempty"` StickerIds []discord.Snowflake `json:"sticker_ids,omitempty"` Attachments []discord.Attachment `json:"attachments,omitempty"` // Only supports "SUPPRESS_EMBEDS" (1<<2) and "SUPPRESS_NOTIFICATIONS" (1<<12) Flags *int `json:"flags,omitempty"` }
type UserClient ¶ added in v0.2.1
func (*UserClient) CreateDMChannel ¶ added in v0.2.1
func (userClient *UserClient) CreateDMChannel() (*discord.Channel, error)
func (*UserClient) GetIdAsString ¶ added in v0.2.1
func (userClient *UserClient) GetIdAsString() string
func (*UserClient) MakeRequest ¶ added in v0.2.1
func (userClient *UserClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
func (*UserClient) SendMessage ¶ added in v0.2.1
func (userClient *UserClient) SendMessage(messageData SendMessageData) (*discord.Message, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.