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 {
TotalMessages uint64
UserMessages map[string]UserMessageStat
UserMessages map[string]*UserMessageStat
}
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]
if !ok {
log.Println("Couldn't find user, making a new one")
o.UserMessages[userID] = UserMessageStat{
o.UserMessages[userID] = &UserMessageStat{
UserID: userID,
Username: m.Author.Username,
MessagesLastDay: 1,
MessagesLastHour: 2,
MessagesLastFive: 3,
MessagesLastDay: 0,
MessagesLastHour: 0,
MessagesLastFive: 0,
}
user = o.UserMessages[userID]
}