Skip to content
Draft
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
42 changes: 42 additions & 0 deletions docs/channel-telegram-games.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
id: channel-telegram-games
title: Gaming Platform
---

https://core.telegram.org/bots/games
https://core.telegram.org/bots/api#games

To get started, send the `/newgame` command to `@BotFather`.

## Sending Games to Chats as Regular Messages

```js
async function App(context) {
await context.sendGame('your-game');
}
```

game button

```js
async function App(context) {
await context.sendGame('your-game', {
replyMarkup: [[{ text: 'Play Now!', callbackGame: {} }]],
});
}
```

> **Note:** This type of button must always be the first button in the first row.

```js
async function App(context) {
if (
context.event.isCallbackQuery &&
context.event.callbackQuery.gameShortName === 'your-game'
) {
await context.answerCallbackQuery({
url: 'https://your-game.tld',
});
}
}
```
5 changes: 3 additions & 2 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
"channel-messenger-profile"
],
"Guides (LINE)": [
"channel-line-setup",
"channel-line-setup",
"channel-line-handling-events",
"channel-line-flex"
],
"Guides (Telegram)": [
"channel-telegram-setup",
"channel-telegram-handling-events"
"channel-telegram-handling-events",
"channel-telegram-games"
],
"Guides (Slack)": ["channel-slack-setup", "channel-slack-handling-events"],
"Guides (Viber)": ["channel-viber-setup", "channel-viber-handling-events"],
Expand Down