mirror of https://github.com/hak5/scuzzy.git
master
parent
651a674830
commit
1abe0c9f5b
|
@ -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]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue