location.go 417 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. loc := tgbotapi.NewLocation(
  15. cid,
  16. compo.Latitude,
  17. compo.Longitude,
  18. )
  19. ret := &SendConfig{
  20. Location: &loc,
  21. }
  22. return ret
  23. }