1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-15 19:33:17 +00:00

Handler: Fixed inconsistency in documentation

This commit is contained in:
diamondburned 2020-07-15 00:48:50 -07:00
parent cb8567f006
commit 880691c51b

View file

@ -3,24 +3,17 @@
// //
// Performance // Performance
// //
// Each call to the event would take 156 ns/op for roughly each handler. Scaling // Each call to the event would take 167 ns/op for roughly each handler. Scaling
// that up to 100 handlers is multiplying 156 ns by 100, which gives 15600 ns, // that up to 100 handlers is roughly the same as multiplying 167 ns by 100,
// or 0.0156 ms. // which gives 16700 ns or 0.0167 ms.
// //
// BenchmarkReflect-8 7260909 156 ns/op // BenchmarkReflect-8 7260909 167 ns/op
// //
// Usage // Usage
// //
// Handler's usage is similar to discordgo, in that AddHandler expects a // Handler's usage is mostly similar to Discordgo, in that AddHandler expects a
// function with only one argument. The only argument must be a pointer to one // function with only one argument or an event channel. For more information,
// of the events, or an interface{} which would accept all events. // refer to AddHandler.
//
// AddHandler would panic if the handler is invalid.
//
// s.AddHandler(func(m *gateway.MessageCreateEvent) {
// log.Println(m.Author.Username, "said", m.Content)
// })
//
package handler package handler
import ( import (