mirror of https://github.com/hak5/scuzzy.git
master
parent
173c012d57
commit
49dbd84b0a
|
@ -33,9 +33,14 @@ func (o *Overwatch) ProcessMessage(s *discordgo.Session, m interface{}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Overwatch) handleUserStat(s *discordgo.Session, m *discordgo.MessageCreate) error {
|
func (o *Overwatch) handleUserStat(s *discordgo.Session, m *discordgo.MessageCreate) error {
|
||||||
|
for _, user := range o.UserMessages {
|
||||||
|
log.Printf("User: %+v\n", user)
|
||||||
|
}
|
||||||
|
|
||||||
userID := m.Author.ID
|
userID := m.Author.ID
|
||||||
user, ok := o.UserMessages[userID]
|
user, ok := o.UserMessages[userID]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
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,
|
||||||
|
@ -55,8 +60,8 @@ func (o *Overwatch) handleUserStat(s *discordgo.Session, m *discordgo.MessageCre
|
||||||
|
|
||||||
func (o *Overwatch) Run() {
|
func (o *Overwatch) Run() {
|
||||||
go func() {
|
go func() {
|
||||||
for range time.Tick(30 * time.Second) {
|
for range time.Tick(10 * time.Second) {
|
||||||
log.Println("Printing UserMessages (30 Seconds)...")
|
log.Println("Printing UserMessages (10 Seconds)...")
|
||||||
for _, user := range o.UserMessages {
|
for _, user := range o.UserMessages {
|
||||||
log.Printf("User: %+v\n", user)
|
log.Printf("User: %+v\n", user)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue