2023-10-11 14:20:25 +03:00
|
|
|
package tg
|
|
|
|
|
|
|
|
import (
|
|
|
|
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Location = tgbotapi.Location
|
|
|
|
|
|
|
|
type LocationCompo struct {
|
2024-03-29 14:30:48 +03:00
|
|
|
MessageCompo
|
2023-10-11 14:20:25 +03:00
|
|
|
Location
|
|
|
|
}
|
|
|
|
|
|
|
|
func (compo *LocationCompo) SendConfig(
|
2024-07-21 16:02:47 +03:00
|
|
|
sid SessionID, bot *Bot,
|
2024-03-29 14:30:48 +03:00
|
|
|
) (SendConfig) {
|
2024-07-21 16:02:47 +03:00
|
|
|
cid := sid.ToAPI()
|
2024-03-29 14:30:48 +03:00
|
|
|
location := tgbotapi.NewLocation(
|
2023-10-11 14:20:25 +03:00
|
|
|
cid,
|
|
|
|
compo.Latitude,
|
|
|
|
compo.Longitude,
|
|
|
|
)
|
2024-03-29 14:30:48 +03:00
|
|
|
|
|
|
|
ret := SendConfig{}
|
|
|
|
ret.Chattable = location
|
2023-10-11 14:20:25 +03:00
|
|
|
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|