Documentation
¶
Index ¶
- Constants
- type ActiveThreadsResponse
- 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
- func (channelClient *ChannelClient) AddThreadMember(userId discord.Snowflake) error
- func (channelClient *ChannelClient) CreateThread(threadData CreateThreadData) (*discord.Channel, error)
- func (channelClient *ChannelClient) Edit(data ModifyChannelData) (*discord.Channel, error)
- func (channelClient *ChannelClient) FetchChannel() (*discord.Channel, error)
- func (channelClient *ChannelClient) GetThreadMember(request GetThreadMemberRequest) (*discord.ThreadMember, error)
- func (channelClient *ChannelClient) JoinThread() error
- func (channelClient *ChannelClient) LeaveThread() error
- func (channelClient *ChannelClient) ListThreadMembers(request ListThreadMemberRequest) ([]discord.ThreadMember, error)
- func (channelClient *ChannelClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
- func (channelClient *ChannelClient) RemoveThreadMember(userId discord.Snowflake) error
- func (channelClient *ChannelClient) SendMessage(messageData SendMessageData) (*discord.Message, error)
- type CreateThreadData
- type DiscordRequest
- type GetThreadMemberRequest
- type GuildClient
- func (guildClient *GuildClient) FetchGuild() (*discord.Guild, error)
- func (guildClient *GuildClient) GetActiveThreads() (ActiveThreadsResponse, error)
- func (guildClient *GuildClient) GetMemberClient(memberId discord.Snowflake) *MemberClient
- func (guildClient *GuildClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
- type ListThreadMemberRequest
- type MemberClient
- type ModifyChannelData
- type ModifyGroupDMChannelData
- type ModifyGuildChannelData
- type ModifyMemberRoleOpts
- type ModifyThreadData
- type SendMessageData
- type ThreadType
- 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 ActiveThreadsResponse ¶ added in v0.3.2
type ActiveThreadsResponse struct {
Threads []discord.Channel `json:"threads"`
ThreadMembers []discord.ThreadMember `json:"members"`
}
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) AddThreadMember ¶ added in v0.3.5
func (channelClient *ChannelClient) AddThreadMember(userId discord.Snowflake) error
func (*ChannelClient) CreateThread ¶ added in v0.3.2
func (channelClient *ChannelClient) CreateThread(threadData CreateThreadData) (*discord.Channel, error)
func (*ChannelClient) Edit ¶ added in v0.3.2
func (channelClient *ChannelClient) Edit(data ModifyChannelData) (*discord.Channel, error)
func (*ChannelClient) FetchChannel ¶ added in v0.3.4
func (channelClient *ChannelClient) FetchChannel() (*discord.Channel, error)
func (*ChannelClient) GetThreadMember ¶ added in v0.3.5
func (channelClient *ChannelClient) GetThreadMember(request GetThreadMemberRequest) (*discord.ThreadMember, error)
func (*ChannelClient) JoinThread ¶ added in v0.3.5
func (channelClient *ChannelClient) JoinThread() error
func (*ChannelClient) LeaveThread ¶ added in v0.3.5
func (channelClient *ChannelClient) LeaveThread() error
func (*ChannelClient) ListThreadMembers ¶ added in v0.3.5
func (channelClient *ChannelClient) ListThreadMembers(request ListThreadMemberRequest) ([]discord.ThreadMember, error)
func (*ChannelClient) MakeRequest ¶ added in v0.2.1
func (channelClient *ChannelClient) MakeRequest(discordRequest DiscordRequest) (response *http.Response, err error)
func (*ChannelClient) RemoveThreadMember ¶ added in v0.3.5
func (channelClient *ChannelClient) RemoveThreadMember(userId discord.Snowflake) error
func (*ChannelClient) SendMessage ¶ added in v0.2.1
func (channelClient *ChannelClient) SendMessage(messageData SendMessageData) (*discord.Message, error)
type CreateThreadData ¶ added in v0.3.2
type CreateThreadData struct {
Name string `json:"name"`
// Seconds
AutoArchiveDuration *int `json:"auto_archive_duration,omitempty"`
// Valid types: AnnouncementThread, PublicThread, PrivateThread
Type discord.ChannelType `json:"type"`
// Whether non-mods can invite (only if private thread)
Invitable *bool `json:"invitable,omitempty"`
// Seconds
RateLimit *int `json:"rate_limit_per_user,omitempty"`
Reason *string `json:"-"` // Audit log reason, optional
}
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 GetThreadMemberRequest ¶ added in v0.3.5
type GuildClient ¶
func (*GuildClient) FetchGuild ¶ added in v0.2.5
func (guildClient *GuildClient) FetchGuild() (*discord.Guild, error)
func (*GuildClient) GetActiveThreads ¶ added in v0.3.2
func (guildClient *GuildClient) GetActiveThreads() (ActiveThreadsResponse, 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 ListThreadMemberRequest ¶ added in v0.3.5
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 ModifyChannelData ¶ added in v0.3.2
type ModifyGroupDMChannelData ¶ added in v0.3.2
type ModifyGroupDMChannelData struct {
Name *string `json:"name,omitempty"`
IconBytes []byte `json:"-"`
Icon *string `json:"icon,omitempty"`
Reason *string `json:"-"` // Audit log reason, optional
}
func (ModifyGroupDMChannelData) GetReason ¶ added in v0.3.2
func (modifyData ModifyGroupDMChannelData) GetReason() *string
func (ModifyGroupDMChannelData) ToJson ¶ added in v0.3.2
func (modifyData ModifyGroupDMChannelData) ToJson() ([]byte, error)
type ModifyGuildChannelData ¶ added in v0.3.2
type ModifyGuildChannelData struct {
Name *string `json:"name,omitempty"`
// Can only switch between text and announcement channels
Type *discord.ChannelType `json:"type,omitempty"`
Position *int `json:"position,omitempty"`
Topic *string `json:"topic,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
// Slow-mode (in seconds)
RateLimit *int `json:"rate_limit_per_user,omitempty"`
// Voice Channels Only:
Bitrate *int `json:"bitrate,omitempty"`
UserLimit *int `json:"user_limit,omitempty"`
RtcRegion *string `json:"rtc_region,omitempty"`
VideoQualityMode *int `json:"video_quality_mode,omitempty"`
// Default archive duration for user-created threads (in minutes), supports: 60, 1440, 4320, 10080
DefaultAutoArchiveDuration *int `json:"default_auto_archive_duration,omitempty"`
// Slow-mode (in seconds)
DefaultThreadRateLimit *int `json:"default_thread_rate_limit_per_user,omitempty"`
PermissionOverwrites []discord.Overwrite `json:"permission_overwrites,omitempty"`
// Category ID
ParentId *discord.Snowflake `json:"parent_id,omitempty"`
// Forums Only:
// Only supports REQUIRE_TAG (1<<4)
Flags *int `json:"flags,omitempty"`
AvailableTags []discord.Tag `json:"available_tags,omitempty"`
DefaultReactionEmoji *discord.DefaultReaction `json:"default_reaction_emoji,omitempty"`
DefaultSortOrder *int `json:"default_sort_order,omitempty"`
DefaultForumLayout *int `json:"default_forum_layout,omitempty"`
Reason *string `json:"-"` // Audit log reason, optional
}
func (ModifyGuildChannelData) GetReason ¶ added in v0.3.2
func (modifyData ModifyGuildChannelData) GetReason() *string
func (ModifyGuildChannelData) ToJson ¶ added in v0.3.2
func (modifyData ModifyGuildChannelData) ToJson() ([]byte, error)
type ModifyMemberRoleOpts ¶
type ModifyThreadData ¶ added in v0.3.2
type ModifyThreadData struct {
Name *string `json:"name,omitempty"`
Archived *bool `json:"archived,omitempty"`
// Minutes, only supports: 60, 1440, 4320, 10080
AutoArchiveDuration *int `json:"auto_archive_duration,omitempty"`
Locked *bool `json:"locked,omitempty"`
Invitable *bool `json:"invitable,omitempty"`
// Slow-mode (in seconds)
RateLimit *int `json:"rate_limit_per_user,omitempty"`
Flags *int `json:"flags,omitempty"`
AppliedTags []discord.Tag `json:"applied_tags,omitempty"`
Reason *string `json:"-"` // Audit log reason, optional
}
func (ModifyThreadData) GetReason ¶ added in v0.3.2
func (modifyData ModifyThreadData) GetReason() *string
func (ModifyThreadData) ToJson ¶ added in v0.3.2
func (modifyData ModifyThreadData) ToJson() ([]byte, error)
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 ThreadType ¶ added in v0.3.2
type ThreadType uint8
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.