pepster/pepster.go

35 lines
533 B
Go
Raw Normal View History

2021-07-19 22:06:54 +00:00
package main
import (
"fmt"
"github.com/bwmarrin/discordgo"
"gorm.io/gorm"
)
type Pepster struct {
config *Config
db *gorm.DB
discord *discordgo.Session
updateStatus chan bool
}
func (p *Pepster) Init() {
go (func() {
fmt.Println("listening")
for _ = range p.updateStatus {
_ = p.discord.UpdateStatusComplex(discordgo.UpdateStatusData{
AFK: false,
Status: "hellosu",
})
fmt.Println("lol Update")
}
})()
}
func (p *Pepster) Close() {
p.unregisterAllCommands(false)
p.discord.Close()
}