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)
|
|
|
|
|
2021-10-14 21:48:47 +02:00
|
|
|
reply := fmt.Sprintf("Pong! :) Commands used: %v, Last restart: %v", commandCount, botUptime)
|
|
|
|
client.Say(channel, reply)
|
2021-10-14 18:46:16 +02:00
|
|
|
}
|