Documentation ¶
Index ¶
- Constants
- Variables
- func ConnectDB()
- func ConnectDiscord(events []interface{})
- func ConnectKafka()
- func ConnectRedis()
- func DisconnectDB()
- func DisconnectDiscord()
- func DisconnectKafka()
- func DisconnectRedis()
- func ReadyMessageCache()
- func RegisterCommands(s *discordgo.Session, g string)
- type CachedMessage
- type Command
- type KafkaService
- type MessageCache
Constants ¶
View Source
const MaxMessageCacheSize = 5_000
Variables ¶
View Source
var Commands = make(map[string]*Command)
View Source
var DB *sql.DB
View Source
var Discord *discordgo.Session
View Source
var Redis *r.Client
View Source
var RegisteredCommands = make([]*discordgo.ApplicationCommand, len(Commands))
Functions ¶
func ConnectDiscord ¶
func ConnectDiscord(events []interface{})
func ConnectKafka ¶
func ConnectKafka()
func ConnectRedis ¶
func ConnectRedis()
func DisconnectDB ¶
func DisconnectDB()
func DisconnectDiscord ¶
func DisconnectDiscord()
func DisconnectKafka ¶
func DisconnectKafka()
func DisconnectRedis ¶
func DisconnectRedis()
func ReadyMessageCache ¶
func ReadyMessageCache()
func RegisterCommands ¶
Types ¶
type CachedMessage ¶
type CachedMessage struct { ID string Content string ChannelID string GuildID string Author *discordgo.User Attachments []*discordgo.MessageAttachment }
message cache stuff
type Command ¶
type Command struct { *discordgo.ApplicationCommand Handler func(*discordgo.Session, *discordgo.InteractionCreate) *discordgo.InteractionResponse }
type KafkaService ¶
type KafkaService struct {
// contains filtered or unexported fields
}
var Kafka *KafkaService
type MessageCache ¶
type MessageCache struct { Messages map[string]*list.Element Order *list.List MaxSize int Mutex sync.Mutex }
var MsgCache *MessageCache
func NewMessageCache ¶
func NewMessageCache() *MessageCache
func (*MessageCache) AddMessage ¶
func (mc *MessageCache) AddMessage(msg *discordgo.Message)
func (*MessageCache) GetMessage ¶
func (mc *MessageCache) GetMessage(id string) (*CachedMessage, bool)
Click to show internal directories.
Click to hide internal directories.