guilds

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveFromCache

func RemoveFromCache(guildID string)

RemoveFromCache removes a guild from the cache

Types

type Guild

type Guild struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"`
	DiscordID string             `bson:"discordID"`
	Settings  GuildSettings      `bson:"settings"`
}

Guild represents a bot guild

func Retrieve

func Retrieve(guildID string) (*Guild, error)

Retrieve retrieves a guild from the database

func RetrieveCached

func RetrieveCached(guildID string) (*Guild, error)

RetrieveCached retrieves a guild but checks the cache first

func (*Guild) Update

func (guild *Guild) Update() error

Update overrides the databases variables with the local ones

type GuildSettings

type GuildSettings struct {
	CommandChannels []string               `bson:"commandChannels"`
	Starboard       GuildStarboardSettings `bson:"starboard"`
}

GuildSettings represents the settings for a bot guild

type GuildStarboardSettings

type GuildStarboardSettings struct {
	Channel string `bson:"channel"`
	Minimum int    `bson:"minimum"`
}

GuildStarboardSettings represents the starboard settings for a guild

Jump to

Keyboard shortcuts

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