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.
This commit is contained in:
Fd
2026-07-06 18:53:04 +07:00
commit faeda0b21d
14 changed files with 1054 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
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))
},
}
+5
View File
@@ -0,0 +1,5 @@
package cmds
import (
_ "neo/cmds/misc"
)