db

package
v1.16.4 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomizableMessages = map[string]string{}

CustomizableMessages maps customizable messages to their default values.

View Source
var Prefixes = []string{"conf"}

Prefixes holds a slice of strings that prefixes guild configuration hashmaps.

Functions

func AdvanceTotalMessages

func AdvanceTotalMessages() error

AdvanceTotalMessages advances the message counter.

func ClearBroadcastMessage

func ClearBroadcastMessage() error

ClearBroadcastMessage clears the broadcast buffer.

func ExpEnabled

func ExpEnabled(gid string) (enabled bool, err error)

ExpEnabled queries whether the experience system is enabled for a guild.

func GetBroadcastMessage

func GetBroadcastMessage() (string, error)

GetBroadcastMessage gets the broadcast buffer.

func GetCustomizableMessage

func GetCustomizableMessage(gid string, key string) (string, error)

GetCustomizableMessage gets a guild-specific message within predefined messages, returning default if not present.

func GetGuildConfValue

func GetGuildConfValue(id, key string) (string, error)

GetGuildConfValue gets a configuration value for a specific guild

func GetMemberExp

func GetMemberExp(user *discordgo.User, guild *discordgo.Guild) (int, error)

GetMemberExp obtains experience amount of a guild member.

func GetRankBind

func GetRankBind(guild *discordgo.Guild, level int) (string, error)

GetRankBind gets binding of a role to a level.

func GetRankBinds

func GetRankBinds(guild *discordgo.Guild) (map[string]string, error)

GetRankBinds gets binding of a role to a level.

func GetTotalMessages

func GetTotalMessages() int

GetTotalMessages gets the message counter.

func GetWarning

func GetWarning(gid, uid string) (string, error)

GetWarning gets warning data of a user.

func HighlightBindMessage

func HighlightBindMessage(gid, message, highlight string) error

HighlightBindMessage binds a message with the highlight message.

func HighlightGetBinding

func HighlightGetBinding(gid, message string) (string, error)

HighlightGetBinding gets the binding of a message.

func HighlightUnbindMessage

func HighlightUnbindMessage(gid, message string) error

HighlightUnbindMessage unbinds a message with the highlight message.

func ResetGuild

func ResetGuild(gid string)

ResetGuild deletes all db values that belongs to a specific guild.

func ResetGuildConfValue

func ResetGuildConfValue(id, key string) error

ResetGuildConfValue resets a configuration value for a specific guild

func ResetGuildMap

func ResetGuildMap(gid, key string)

ResetGuildMap deletes a map that belongs to a specific guild.

func SetBroadcastMessage

func SetBroadcastMessage(message string) error

SetBroadcastMessage sets the broadcast buffer.

func SetCustomizableMessage

func SetCustomizableMessage(gid string, key string, message string) error

SetCustomizableMessage sets a guild-specific message string within predefined messages.

func SetGuildConfValue

func SetGuildConfValue(id, key, value string) error

SetGuildConfValue sets a configuration value for a specific guild

func SetMemberExp

func SetMemberExp(user *discordgo.User, guild *discordgo.Guild, exp int) error

SetMemberExp sets a member's experience amount.

func SetRankBind

func SetRankBind(guild *discordgo.Guild, level int, role *discordgo.Role) error

SetRankBind binds a role to a level.

func SetWarning

func SetWarning(gid, uid, body string) error

SetWarning sets warning data of a user.

func UnsetRankBind

func UnsetRankBind(guild *discordgo.Guild, level string) error

UnsetRankBind unbinds a role from a level.

Types

type MessageOutOfBounds

type MessageOutOfBounds struct{}

MessageOutOfBounds represents an out of bounds message.

func (MessageOutOfBounds) Error

func (err MessageOutOfBounds) Error() string

Error returns error.

Jump to

Keyboard shortcuts

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