Documentation
¶
Index ¶
- Constants
- Variables
- type ChannelData
- type ConnectionData
- type DiscordAPI
- func (a *DiscordAPI) CreateDM(recipient_id snowflake.Node) (ChannelData, error)
- func (a *DiscordAPI) CreateGroupDM(access_tokens []string, nicks map[snowflake.Node]string) (ChannelData, error)
- func (a *DiscordAPI) GetCurrentUser() (UserData, error)
- func (a *DiscordAPI) GetCurrentUserGuilds(before snowflake.Node, after snowflake.Node, limit int) ([]GuildData, error)
- func (a *DiscordAPI) GetUser(id snowflake.Node) (UserData, error)
- func (a *DiscordAPI) GetUserConnections() ([]ConnectionData, error)
- func (a *DiscordAPI) LeaveGuild(id snowflake.Node) error
- func (a *DiscordAPI) ModifyCurrentUser(username string, avatar image_data) (UserData, error)
- type GuildData
- type IDiscordAPI
- type UserData
Constants ¶
const ( None = 0 DiscordEmployee = 1 << 0 PartneredServerOwner = 1 << 1 HypeSquadEvents = 1 << 2 BugHunterLevel1 = 1 << 3 HouseBravery = 1 << 6 HouserBrilliance = 1 << 7 HouseBalance = 1 << 8 EarlySupporter = 1 << 9 TeamUser = 1 << 10 BugHunterLevel2 = 1 << 14 VerifiedBot = 1 << 16 EarlyVerifiedBotDeveloper = 1 << 17 DiscordCertifiedModerator = 1 << 18 )
const ( // None = 0 Nitro_Classic = 1 Nitro = 2 )
Variables ¶
var ErrorNotImplemented = errors.New("This function is not implemented.")
Functions ¶
This section is empty.
Types ¶
type ChannelData ¶
type ChannelData struct {
}
type ConnectionData ¶
type ConnectionData struct {
}
type DiscordAPI ¶
type DiscordAPI struct{}
func (*DiscordAPI) CreateDM ¶
func (a *DiscordAPI) CreateDM(recipient_id snowflake.Node) (ChannelData, error)
POST/users/@me/channels Create a new DM channel with a user. Returns a DM channel object. ! You should not use this endpoint to DM everyone in a server about something. DMs should generally be initiated by a user action. If you open a significant amount of DMs too quickly, your bot may be rate limited or blocked from opening new ones.
func (*DiscordAPI) CreateGroupDM ¶
func (a *DiscordAPI) CreateGroupDM(access_tokens []string, nicks map[snowflake.Node]string) (ChannelData, error)
POST/users/@me/channels Create a new group DM channel with multiple users. Returns a DM channel object. This endpoint was intended to be used with the now-deprecated GameBridge SDK. DMs created with this endpoint will not be shown in the Discord client
func (*DiscordAPI) GetCurrentUser ¶
func (a *DiscordAPI) GetCurrentUser() (UserData, error)
GET/users/@me Returns the user object of the requester's account. For OAuth2, this requires the identify scope, which will return the object without an email, and optionally the email scope, which returns the object with an email.
func (*DiscordAPI) GetCurrentUserGuilds ¶
func (a *DiscordAPI) GetCurrentUserGuilds(before snowflake.Node, after snowflake.Node, limit int) ([]GuildData, error)
GET/users/@me/guilds Returns a list of partial guild objects the current user is a member of. Requires the guilds OAuth2 scope.
func (*DiscordAPI) GetUser ¶
func (a *DiscordAPI) GetUser(id snowflake.Node) (UserData, error)
GET/users/{user.id} Returns a user object for a given user ID.
func (*DiscordAPI) GetUserConnections ¶
func (a *DiscordAPI) GetUserConnections() ([]ConnectionData, error)
GET/users/@me/connections Returns a list of connection objects. Requires the connections OAuth2 scope.
func (*DiscordAPI) LeaveGuild ¶
func (a *DiscordAPI) LeaveGuild(id snowflake.Node) error
DELETE/users/@me/guilds/{guild.id} Leave a guild. Returns a 204 empty response on success.
func (*DiscordAPI) ModifyCurrentUser ¶
func (a *DiscordAPI) ModifyCurrentUser(username string, avatar image_data) (UserData, error)
PATCH/users/@me Modify the requester's user account settings. Returns a user object on success.
type IDiscordAPI ¶
type IDiscordAPI interface {
// User
GetCurrentUser() (UserData, error)
GetUser(id snowflake.Node) (UserData, error)
ModifyCurrentUser(username string, avatar image_data) (UserData, error)
GetCurrentUserGuilds(before snowflake.Node, after snowflake.Node, limit int) ([]GuildData, error)
LeaveGuild(id snowflake.Node) error
CreateDM(recipient_id snowflake.Node) (ChannelData, error)
CreateGroupDM(access_tokens []string, nicks map[snowflake.Node]string) (ChannelData, error)
GetUserConnections() ([]ConnectionData, error)
}