Documentation ¶
Index ¶
- type Resource
- func (r *Resource) Connections(ctx context.Context) ([]discord.UserConnection, error)
- func (r *Resource) DMs(ctx context.Context) ([]discord.Channel, error)
- func (r *Resource) Get(ctx context.Context) (*discord.User, error)
- func (r *Resource) Guilds(ctx context.Context) ([]discord.PartialGuild, error)
- func (r *Resource) LeaveGuild(ctx context.Context, id string) error
- func (r *Resource) Modify(ctx context.Context, username, avatar string) (*discord.User, error)
- func (r *Resource) NewDM(ctx context.Context, recipientID string) (*discord.Channel, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Resource is a resource that allows to perform various actions on a Discord user. Create one with Client.User.
func NewResource ¶
func NewResource(c resource.RestClient, id string) *Resource
func (*Resource) Connections ¶
Connections returns a list of connections for the connected user.
func (*Resource) DMs ¶
DMs returns the list of direct message channels the current user is in. This endpoint does not seem to be available for Bot users, always returning an empty list of channels.
func (*Resource) Guilds ¶
Guilds returns a list of partial guilds the current user is a member of. This endpoint returns at most 100 guilds by default, which is the maximum number of guilds a non-bot user can join. Therefore, pagination is not needed for integrations that need to get a list of users' guilds.
func (*Resource) LeaveGuild ¶
LeaveGuild make the current user leave a guild given its ID.
func (*Resource) Modify ¶
Modify modifies the current user account settings. Avatar is a Data URI scheme that supports JPG, GIF, and PNG formats. An example Data URI format is:
data:image/jpeg;base64,BASE64_ENCODED_JPEG_IMAGE_DATA
Ensure you use the proper header type (image/jpeg, image/png, image/gif) that matches the image data being provided.