user

package
v0.0.0-...-7245f98 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fly

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

Fly is a resource for interacting with the current User.

func New

func New(cli flies.RestClient, token string) *Fly

New creates a new User Fly.

func (*Fly) CreateDM

func (f *Fly) CreateDM(ctx context.Context, id string) (*sigil.Channel, error)

CreateDM creates a new DM with the given id.

func (*Fly) Get

func (f *Fly) Get(ctx context.Context) (*sigil.User, error)

Get fetches the User of the associated token.

func (*Fly) GetConnections

func (f *Fly) GetConnections(ctx context.Context) ([]*sigil.Connection, error)

GetConnections fetches the Connections of the current User.

func (*Fly) GetGuilds

func (f *Fly) GetGuilds(ctx context.Context, before, after string, limit int) ([]*sigil.Guild, error)

GetGuilds returns a list of partial Guilds the current User is part of. Requires the `guilds` scope.

Both the `before` and `after` query parameters are snowflakes.

func (*Fly) LeaveGuild

func (f *Fly) LeaveGuild(ctx context.Context, id string) error

LeaveGuild has the current User leave a Guild.

func (*Fly) Modify

func (f *Fly) Modify(ctx context.Context, opts *ModifyOptions) (*sigil.User, error)

Modify modifies the Current User using the given options.

type ModifyOptions

type ModifyOptions struct {
	Username string      `json:"username,omitempty"`
	Avatar   null.String `json:"avatar,omitempty"`
}

ModifyOptions is used to change the current User's settings.

Jump to

Keyboard shortcuts

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