feat(config): base of guild config
This commit is contained in:
parent
48ca185105
commit
beb0ea0ca4
7 changed files with 238 additions and 13 deletions
|
@ -21,8 +21,7 @@ const (
|
|||
)
|
||||
|
||||
func OnMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
c := Copaing{DiscordID: m.Author.ID, GuildID: m.GuildID}
|
||||
c.Load()
|
||||
c := GetCopaing(m.Author.ID, m.GuildID)
|
||||
// add xp
|
||||
trimmed := utils.TrimMessage(strings.ToLower(m.Content))
|
||||
c.AddXP(s, XPMessage(uint(len(trimmed)), calcDiversity(trimmed)), func(_ uint, _ uint) {
|
||||
|
@ -119,8 +118,7 @@ func onDisconnect(s *discordgo.Session, e *discordgo.VoiceStateUpdate, client *r
|
|||
utils.SendWarn(fmt.Sprintf("User %s spent more than 6 hours in vocal", e.Member.DisplayName()))
|
||||
timeInVocal = MaxTimeInVocal
|
||||
}
|
||||
c := Copaing{DiscordID: u.DiscordID, GuildID: u.GuildID}
|
||||
c.Load()
|
||||
c := GetCopaing(u.DiscordID, u.GuildID)
|
||||
c.AddXP(s, XPVocal(uint(timeInVocal)), func(_ uint, _ uint) {
|
||||
//TODO: handle new level in vocal
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue