34 lines
533 B
Go
34 lines
533 B
Go
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()
|
|
}
|