add ping command

This commit is contained in:
lyx0 2021-10-19 22:45:01 +02:00
parent d10fa74a05
commit 8c0b51894f

View file

@ -4,11 +4,15 @@ import (
"fmt"
"github.com/lyx0/nourybot/cmd/bot"
"github.com/lyx0/nourybot/pkg/humanize"
"github.com/lyx0/nourybot/pkg/utils"
)
func Ping(target string, nb *bot.Bot) {
commandCount := fmt.Sprint(utils.GetCommandsUsed())
botUptime := humanize.Time(nb.Uptime)
reply := fmt.Sprintf("Pong! :) Last restart: %v", nb.Uptime)
reply := fmt.Sprintf("Pong! :) Commands Used: %v, Last restart: %v", commandCount, botUptime)
nb.Send(target, reply)
}