feat: add get users
This commit is contained in:
11
services/utils/mc.go
Normal file
11
services/utils/mc.go
Normal 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
13
services/utils/tg.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user