Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implemented sendVenue #69

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ type Bot interface {
SendAnimation(msg entity.MessageEnvelop) (entity.Message, error)
// SendDice is used to send an animated emoji that will display a random value.
SendDice(msg entity.MessageEnvelop) (entity.Message, error)
// SendVenue is used to send information about a venue.
SendVenue(msg entity.MessageEnvelop) (entity.Message, error)
}

// BotOptions hold the options for the bot
Expand Down
8 changes: 8 additions & 0 deletions default.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,11 @@ func (b *bot) SendDice(msg entity.MessageEnvelop) (entity.Message, error) {

return res, err
}

func (b *bot) SendVenue(msg entity.MessageEnvelop) (entity.Message, error) {
var res entity.Message

err := b.SendMessageAny(MessageVenue, msg, &res)

return res, err
}
15 changes: 15 additions & 0 deletions entity/message_envelop.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,21 @@ type MessageEnvelop struct {
//
// It is a required field for sending a chat action.
Action ChatAction `json:"action"`

// All Parameters for sendVenue method

// Address of the venue
Address string `json:"address,omitempty"`
// FoursquareID of the venue
FoursquareID string `json:"foursquare_id,omitempty"`
// FoursquareType of the venue, if known.
// (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
FoursquareType string `json:"foursquare_type,omitempty"`
// GooglePlaceID of the venue
GooglePlaceID string `json:"google_place_id,omitempty"`
// GooglePlaceType of the venue.
// See supported types at https://developers.google.com/places/web-service/supported_types
GooglePlaceType string `json:"google_place_type,omitempty"`
}

// FileEnvelop represents a file to be uploaded to the telegram server.
Expand Down