CI
All checks were successful
Build Docker Image / build (amd64) (push) Successful in 1m40s

This commit is contained in:
thuanle
2024-10-24 10:05:04 +07:00
parent 92a63c7885
commit b60fcb842d
7 changed files with 81 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
package configs
var Version = "2"

View File

@@ -31,7 +31,7 @@ func setupCommands(b *telebot.Bot) error {
b.Handle("/start", commands.OnStart)
//general
b.Handle("/ip", commands.OnGetIp)
b.Handle("/v", commands.OnGetVersion)
//info
b.Handle("/p", commands.OnGetTopPrices)

View File

@@ -2,11 +2,13 @@ package commands
import (
"gopkg.in/telebot.v3"
"me.thuanle/bbot/internal/configs"
"me.thuanle/bbot/internal/services/tele/chat"
"me.thuanle/bbot/internal/utils/netx"
)
func OnGetIp(context telebot.Context) error {
func OnGetVersion(context telebot.Context) error {
ip := netx.GetPublicIp()
return chat.ReplyMessageCode(context, ip)
msg := "v" + configs.Version + " - " + ip
return chat.ReplyMessageCode(context, msg)
}