fixed nil map error
This commit is contained in:
		
							parent
							
								
									01ba7fafc1
								
							
						
					
					
						commit
						6ed12b7e83
					
				| @ -10,6 +10,8 @@ func (app *application) messageCreate(s *discordgo.Session, m *discordgo.Message | ||||
| 	if m.Author.Bot { | ||||
| 		return | ||||
| 	} | ||||
| 	app.infoLog.Printf("Adding entry\n") | ||||
| 	app.limiter.LogInteraction(m.Author.ID, "messagecreate") | ||||
| 
 | ||||
| 	/* Check if the user is even allowed by the rate limiter */ | ||||
| 	err := app.limiter.CheckAllowed(m.Author.ID) | ||||
| @ -67,7 +69,4 @@ func (app *application) messageCreate(s *discordgo.Session, m *discordgo.Message | ||||
| 		app.findTrigger(s, m) | ||||
| 	} | ||||
| 
 | ||||
| 	app.infoLog.Printf("Adding entry\n") | ||||
| 	app.limiter.LogInteraction(m.Author.ID, "messagecreate") | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -45,6 +45,7 @@ func main() { | ||||
| 	limiter := &limiter.Limiter{ | ||||
| 		RateLimit: 5, | ||||
| 		TimeLimit: time.Second * 15, | ||||
| 		Logs:      make(map[string][]*limiter.Action), | ||||
| 	} | ||||
| 
 | ||||
| 	app := &application{ | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user