feat: add get users

This commit is contained in:
Vaala Cat
2023-05-17 15:14:31 +08:00
parent 199ebba158
commit 50191e20ef
7 changed files with 75 additions and 32 deletions

11
services/utils/mc.go Normal file
View File

@@ -0,0 +1,11 @@
package utils
import "tg-mc/conf"
func GetAlivePlayer() string {
ans := "当前在线玩家:\n"
for _, v := range conf.PlayerList.PlayerInfos {
ans += v.Name + "\n"
}
return ans
}

13
services/utils/tg.go Normal file
View File

@@ -0,0 +1,13 @@
package utils
import (
"tg-mc/conf"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
func SendMsg(msg string) error {
msgT := tgbotapi.NewMessage(conf.GetBotSettings().GroupID, msg)
_, err := conf.Bot.Send(msgT)
return err
}