master
Marc 2021-05-28 23:29:40 +01:00
parent 651a674830
commit 1abe0c9f5b
No known key found for this signature in database
GPG Key ID: 0657563F705ACAAE
1 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ type UserMessageStat struct {
type Overwatch struct { type Overwatch struct {
TotalMessages uint64 TotalMessages uint64
UserMessages map[string]UserMessageStat UserMessages map[string]*UserMessageStat
} }
func (o *Overwatch) ProcessMessage(s *discordgo.Session, m interface{}) { func (o *Overwatch) ProcessMessage(s *discordgo.Session, m interface{}) {
@ -41,12 +41,12 @@ func (o *Overwatch) handleUserStat(s *discordgo.Session, m *discordgo.MessageCre
user, ok := o.UserMessages[userID] user, ok := o.UserMessages[userID]
if !ok { if !ok {
log.Println("Couldn't find user, making a new one") log.Println("Couldn't find user, making a new one")
o.UserMessages[userID] = UserMessageStat{ o.UserMessages[userID] = &UserMessageStat{
UserID: userID, UserID: userID,
Username: m.Author.Username, Username: m.Author.Username,
MessagesLastDay: 1, MessagesLastDay: 0,
MessagesLastHour: 2, MessagesLastHour: 0,
MessagesLastFive: 3, MessagesLastFive: 0,
} }
user = o.UserMessages[userID] user = o.UserMessages[userID]
} }