mirror-nourybot/pkg/commands/ping.go

19 lines
447 B
Go
Raw Normal View History

2021-10-14 18:46:16 +02:00
package commands
import (
"fmt"
2021-10-14 19:02:07 +02:00
"time"
2021-10-14 18:46:16 +02:00
"github.com/gempir/go-twitch-irc/v2"
2021-10-14 19:02:07 +02:00
"github.com/lyx0/nourybot/pkg/humanize"
2021-10-14 18:46:16 +02:00
"github.com/lyx0/nourybot/pkg/utils"
)
2021-10-14 19:02:07 +02:00
func Ping(channel string, client *twitch.Client, uptime time.Time) {
2021-10-14 18:46:16 +02:00
commandCount := fmt.Sprint(utils.GetCommandsUsed())
2021-10-14 19:02:07 +02:00
botUptime := humanize.HumanizeTime(uptime)
s := fmt.Sprintf("Pong! :) Commands used: %v, Last restart: %v", commandCount, botUptime)
2021-10-14 18:46:16 +02:00
client.Say(channel, s)
}