location.go 426 B

1234567891011121314151617181920212223242526272829
  1. package tg
  2. import (
  3. tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
  4. )
  5. type Location = tgbotapi.Location
  6. type LocationCompo struct {
  7. MessageCompo
  8. Location
  9. }
  10. func (compo *LocationCompo) SendConfig(
  11. sid SessionID, bot *Bot,
  12. ) (SendConfig) {
  13. cid := sid.ToAPI()
  14. location := tgbotapi.NewLocation(
  15. cid,
  16. compo.Latitude,
  17. compo.Longitude,
  18. )
  19. ret := SendConfig{}
  20. ret.Chattable = location
  21. return ret
  22. }