mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add ping command
This commit is contained in:
parent
d10fa74a05
commit
8c0b51894f
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue