Files
neo/cmds/misc/ping.go
T
Fd faeda0b21d feat: initial whatsmeow bot with command handler and context helpers
Core framework (Handler, Command, Default muxer) in core/ package.
Command self-registration via init() with blank imports in cmds/.
Context helpers (send, reply, download, upload) in context/ package.
Permission system with GROUP_ONLY / PRIVATE_ONLY checks.
WhatsApp client configured as Safari with history sync disabled.
2026-07-06 18:53:04 +07:00

25 lines
502 B
Go

package misc
import (
"fmt"
"time"
hc "neo/context"
"neo/core"
)
func init() { core.Default.Register(Ping) }
var Ping = &core.Command{
Name: "ping",
Aliases: []string{"test", "tes", "p"},
Category: "general",
Description: "Check bot response time",
Permissions: []core.Permission{core.PermissionGroupOnly},
Run: func(ctx *hc.Ctx) {
t := ctx.Event().Info.Timestamp
speed := time.Since(t).Milliseconds()
ctx.Reply(fmt.Sprintf("Pong! 🏓\n\nSpeed: %d ms", speed))
},
}