Documentation ¶
Overview ¶
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
Index ¶
- Constants
- Variables
- type CustomCommand
- type DB
- func (db *DB) AddToBlacklist(guildID discord.GuildID, channelID discord.ChannelID) (err error)
- func (db *DB) AddToWatchlist(guildID discord.GuildID, userID discord.UserID) (err error)
- func (db *DB) AllCustomCommands(guildID discord.GuildID) (c []CustomCommand, err error)
- func (db *DB) CreateServerIfNotExists(guildID discord.GuildID) (exists bool, err error)
- func (db *DB) CustomCommand(guildID discord.GuildID, name string) (c CustomCommand, err error)
- func (db *DB) CustomCommandID(guildID discord.GuildID, id int64) (c CustomCommand, err error)
- func (db *DB) DelNote(guildID discord.GuildID, id uint64) (err error)
- func (db *DB) GuildBoolGet(guildID discord.GuildID, key string) (val bool, err error)
- func (db *DB) GuildBoolSet(guildID discord.GuildID, key string, val bool) error
- func (db *DB) GuildIntGet(guildID discord.GuildID, key string) (val int64, err error)
- func (db *DB) GuildIntSet(guildID discord.GuildID, key string, val int64) error
- func (db *DB) GuildKeyDelete(guildID discord.GuildID, key string) error
- func (db *DB) GuildStringGet(guildID discord.GuildID, key string) (val string, err error)
- func (db *DB) GuildStringSet(guildID discord.GuildID, key, val string) error
- func (db *DB) GuildUserBoolGet(guildID discord.GuildID, userID discord.UserID, key string) (val bool, err error)
- func (db *DB) GuildUserBoolSet(guildID discord.GuildID, userID discord.UserID, key string, val bool) error
- func (db *DB) GuildUserIntGet(guildID discord.GuildID, userID discord.UserID, key string) (val int64, err error)
- func (db *DB) GuildUserIntSet(guildID discord.GuildID, userID discord.UserID, key string, val int64) error
- func (db *DB) GuildUserKeyDelete(guildID discord.GuildID, userID discord.UserID, key string) error
- func (db *DB) GuildUserStringGet(guildID discord.GuildID, userID discord.UserID, key string) (val string, err error)
- func (db *DB) GuildUserStringSet(guildID discord.GuildID, userID discord.UserID, key, val string) error
- func (db *DB) IsBlacklisted(guildID discord.GuildID, channelID discord.ChannelID) (b bool)
- func (db *DB) IsWatchlisted(guildID discord.GuildID, userID discord.UserID) (b bool)
- func (db *DB) NewNote(n Note) (Note, error)
- func (db *DB) Permissions(guildID discord.GuildID) (ns common.Nodes, err error)
- func (db *DB) Prefixes(id discord.GuildID) (prefixes []string, err error)
- func (db *DB) RemoveFromBlacklist(guildID discord.GuildID, channelID discord.ChannelID) (err error)
- func (db *DB) RemoveFromWatchlist(guildID discord.GuildID, userID discord.UserID) (err error)
- func (db *DB) ResetPermissions(guildID discord.GuildID, node string) (err error)
- func (db *DB) SaveStarboardMessage(s StarboardMessage) (err error)
- func (db *DB) SetCustomCommand(guildID discord.GuildID, name, source string) (c CustomCommand, err error)
- func (db *DB) SetPermissions(guildID discord.GuildID, node string, level common.PermissionLevel) (err error)
- func (db *DB) SetPrefixes(id discord.GuildID, prefixes []string) (err error)
- func (db *DB) SetStarboard(id discord.GuildID, s StarboardSettings) (err error)
- func (db *DB) Starboard(id discord.GuildID) (s StarboardSettings, err error)
- func (db *DB) StarboardBlacklist(id discord.GuildID) (bl []uint64, err error)
- func (db *DB) StarboardChannelWebhook(id discord.ChannelID) (wh Webhook, err error)
- func (db *DB) StarboardMessage(id discord.MessageID) (m *StarboardMessage, err error)
- func (db *DB) StarboardWebhook(id discord.WebhookID) (wh Webhook, err error)
- func (db *DB) UserBoolGet(userID discord.UserID, key string) (val bool, err error)
- func (db *DB) UserBoolSet(userID discord.UserID, key string, val bool) error
- func (db *DB) UserIntGet(userID discord.UserID, key string) (val int64, err error)
- func (db *DB) UserIntSet(userID discord.UserID, key string, val int64) error
- func (db *DB) UserKeyDelete(userID discord.UserID, key string) error
- func (db *DB) UserNotes(guildID discord.GuildID, userID discord.UserID) (notes []Note, err error)
- func (db *DB) UserStringGet(userID discord.UserID, key string) (val string, err error)
- func (db *DB) UserStringSet(userID discord.UserID, key, val string) error
- func (db *DB) Watchlist(guildID discord.GuildID) (list []uint64, err error)
- func (db *DB) WatchlistChannel(guildID discord.GuildID) (c discord.ChannelID, err error)
- type Note
- type StarboardMessage
- type StarboardSettings
- type Webhook
Constants ¶
const ErrCommandNotFound = errors.Sentinel("no cc with that name found")
Variables ¶
var ( ErrorAlreadyBlacklisted = errors.New("channel is already blacklisted") ErrorNotBlacklisted = errors.New("channel is not blacklisted") )
Errors for setting the blacklist
var (
ErrNoteNotFound = errors.New("note not found")
)
...
var (
ErrTimedOut = errors.New("db: timed out")
)
Misc errors
Functions ¶
This section is empty.
Types ¶
type CustomCommand ¶
type DB ¶
DB ...
func (*DB) AddToBlacklist ¶
AddToBlacklist adds the given channelID to the blacklist for guildID
func (*DB) AddToWatchlist ¶
AddToWatchlist adds the given userID to the watchlist for guildID
func (*DB) AllCustomCommands ¶
func (db *DB) AllCustomCommands(guildID discord.GuildID) (c []CustomCommand, err error)
func (*DB) CreateServerIfNotExists ¶
CreateServerIfNotExists returns true if the server exists
func (*DB) CustomCommand ¶
func (*DB) CustomCommandID ¶
func (*DB) GuildBoolGet ¶
func (*DB) GuildBoolSet ¶
func (*DB) GuildIntGet ¶
func (*DB) GuildIntSet ¶
func (*DB) GuildStringGet ¶
func (*DB) GuildStringSet ¶
func (*DB) GuildUserBoolGet ¶
func (*DB) GuildUserBoolSet ¶
func (*DB) GuildUserIntGet ¶
func (*DB) GuildUserIntSet ¶
func (*DB) GuildUserKeyDelete ¶
func (*DB) GuildUserStringGet ¶
func (*DB) GuildUserStringSet ¶
func (*DB) IsBlacklisted ¶
IsBlacklisted returns true if a channel is blacklisted
func (*DB) IsWatchlisted ¶
IsWatchlisted returns true if a user is on the watchlist
func (*DB) Permissions ¶
Permissions returns the given guild's permission overrides.
func (*DB) RemoveFromBlacklist ¶
RemoveFromBlacklist removes the given channelID from the blacklist for guildID
func (*DB) RemoveFromWatchlist ¶
RemoveFromWatchlist removes the given userID from the watchlist for guildID
func (*DB) ResetPermissions ¶
ResetPermissions removes the override for the given node.
func (*DB) SaveStarboardMessage ¶
func (db *DB) SaveStarboardMessage(s StarboardMessage) (err error)
SaveStarboardMessage ...
func (*DB) SetCustomCommand ¶
func (*DB) SetPermissions ¶
func (db *DB) SetPermissions(guildID discord.GuildID, node string, level common.PermissionLevel) (err error)
SetPermissions adds a guild-level override for the given node.
func (*DB) SetPrefixes ¶
SetPrefixes sets the prefixes for a server
func (*DB) SetStarboard ¶
func (db *DB) SetStarboard(id discord.GuildID, s StarboardSettings) (err error)
SetStarboard sets the starboard settings for a server
func (*DB) Starboard ¶
func (db *DB) Starboard(id discord.GuildID) (s StarboardSettings, err error)
Starboard gets the starboard settings for a server
func (*DB) StarboardBlacklist ¶
StarboardBlacklist gets the current starboard blacklist
func (*DB) StarboardChannelWebhook ¶
func (*DB) StarboardMessage ¶
func (db *DB) StarboardMessage(id discord.MessageID) (m *StarboardMessage, err error)
StarboardMessage gets a starboard message by ID
func (*DB) StarboardWebhook ¶
func (*DB) UserBoolGet ¶
func (*DB) UserBoolSet ¶
func (*DB) UserIntGet ¶
func (*DB) UserIntSet ¶
func (*DB) UserStringGet ¶
func (*DB) UserStringSet ¶
type Note ¶
type Note struct { ID uint64 ServerID discord.GuildID UserID discord.UserID Note string Moderator discord.UserID Created time.Time }
Note is a note
type StarboardMessage ¶
type StarboardMessage struct { MessageID discord.MessageID ChannelID discord.ChannelID ServerID discord.GuildID StarboardMessageID discord.MessageID WebhookID *discord.WebhookID }
StarboardMessage is a single starboard message