sendVenue
Use this method to send information about a venue. On success, the sent Message is returned.
Parameters
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idIntegerStringRequiredUnique identifier for the target chat or username of the target channel (in the format
@channelusername)message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
latitudeFloatRequiredLatitude of the venue
longitudeFloatRequiredLongitude of the venue
titleStringRequiredName of the venue
addressStringRequiredAddress of the venue
foursquare_idStringOptionalFoursquare identifier of the venue
foursquare_typeStringOptionalFoursquare type of the venue, if known. (For example, "arts\entertainment/default", "arts\entertainment/aquarium" or "food/icecream".)
google_place_idStringOptionalGoogle Places identifier of the venue
google_place_typeStringOptionalGoogle Places type of the venue. (See supported types.)
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
Description of the message to reply to
reply_markupInlineKeyboardMarkupReplyKeyboardMarkupReplyKeyboardRemoveForceReplyOptional⌨️ KeyboardsAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
Returns
On success, the Message object is returned.
GramIO Usage
ts
// Send a minimal venue with just coordinates, name, and address
bot.command("office", (ctx) =>
ctx.sendVenue({
latitude: 37.7749,
longitude: -122.4194,
title: "GramIO HQ",
address: "San Francisco, CA",
})
);ts
// Venue enriched with Foursquare metadata for a richer card
bot.command("cafe", (ctx) =>
ctx.sendVenue({
latitude: 48.8566,
longitude: 2.3522,
title: "Café de Flore",
address: "172 Bd Saint-Germain, 75006 Paris",
foursquare_id: "4adcda04f964a5208f3521e3",
foursquare_type: "food/coffeeshop",
})
);ts
// Venue with Google Places ID for Maps integration
bot.command("museum", (ctx) =>
ctx.sendVenue({
latitude: 51.5074,
longitude: -0.1278,
title: "The British Museum",
address: "Great Russell St, London WC1B 3DG",
google_place_id: "ChIJB9OTMDIbdkgRp0JWbW3M4kM",
google_place_type: "museum",
})
);ts
// Reply to a message with a venue and navigation button
bot.command("meetup", (ctx) =>
ctx.replyWithVenue({
latitude: 40.7128,
longitude: -74.006,
title: "Team Meetup Spot",
address: "New York, NY 10007",
reply_markup: new InlineKeyboard().url(
"Open in Maps",
"https://maps.google.com/?q=40.7128,-74.006"
),
})
);Errors
| Code | Error | Cause |
|---|---|---|
| 400 | Bad Request: chat not found | Invalid or inaccessible chat_id — verify the chat exists and the bot is a member |
| 400 | Bad Request: VENUE_ADDRESS_INVALID | The address field is empty or invalid |
| 400 | Bad Request: VENUE_TITLE_INVALID | The title field is empty or too long |
| 400 | Bad Request: Bad latitude/longitude | Coordinates are outside valid ranges (latitude −90 to 90, longitude −180 to 180) |
| 403 | Forbidden: bot was blocked by the user | The target user has blocked the bot |
| 403 | Forbidden: not enough rights | Bot lacks can_send_messages permission in the group/channel |
| 429 | Too Many Requests: retry after N | Flood control triggered — use the auto-retry plugin to handle this automatically |
Auto-retry for 429 errors
Install the @gramio/auto-retry plugin to transparently handle flood-wait errors without manual retry logic.
Tips & Gotchas
- Venue vs. Location.
sendVenueshows a named card with title and address in Telegram — use it when you have a meaningful place name. UsesendLocationwhen you only have coordinates. - Foursquare and Google Places IDs are independent. You can provide either, both, or neither. When both are present Telegram prefers Google Places for the enriched card.
- Coordinates must be valid floats. Latitude must be in the range −90 to 90 and longitude in −180 to 180. Out-of-range values result in a 400 error.
- No live-location updates.
sendVenuesends a static pin. If you need a location that updates in real time, usesendLocationwithlive_period. - The address is mandatory. Even if you supply a Foursquare or Google Place ID, the
addressfield cannot be empty. - Venue messages cannot be edited to change coordinates. Once sent, the latitude/longitude of a venue message is fixed. Send a new message if the location changes.
See Also
- sendLocation — Send a live or static map pin without a place name
- sendContact — Send a contact card with phone number
- Venue — The Venue type embedded in Message
- Location — The Location type (coordinates only)
- Keyboards overview — Add reply markup to venue messages
- sendMessage — Send a plain text message