godacl

package module
v0.0.0-...-45e2002 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2021 License: MIT Imports: 2 Imported by: 0

README

godacl

[Work in Progress] One-To-One API bindings for Discord using Golang. If you are looking for a complete project, check out discord-go by bwmarrin (https://github.com/bwmarrin/discordgo)

Documentation

Index

Constants

View Source
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
)
View Source
const (
	// None = 0
	Nitro_Classic = 1
	Nitro         = 2
)

Variables

View Source
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 GuildData

type GuildData struct{}

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)
}

type UserData

type UserData struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL