discord

package
v0.0.0-...-ad55457 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BotSession *discordgo.Session
	Guilds     map[string]Guild
}

func NewClient

func NewClient(token string) (*Client, error)

func (*Client) AddMemberRole

func (c *Client) AddMemberRole(userID, guildName string) error

func (*Client) GuildMembers

func (c *Client) GuildMembers() (map[string]map[string]Member, error)

func (*Client) HasMemberRole

func (c *Client) HasMemberRole(member Member, guildName string) bool

func (*Client) RemoveMemberRole

func (c *Client) RemoveMemberRole(userID, guildName string) error

type Guild

type Guild struct {
	ID               string `mapstructure:"id"`
	MemberRoleID     string `mapstructure:"memberRole"`
	WelcomeChannelID string `mapstructure:"welcomeChannel"`
}

type Member

type Member struct {
	ID         string
	ServerNick string
	Username   string
	GlobalName string
	GuildID    string
	Roles      []string
}

func (Member) Nick

func (m Member) Nick() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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