Agent skill

Handle Callback Query

by vendelieu in vendelieu/telegram-bot

Handles inline keyboard button presses and provides user feedback via answerCallbackQuery.

Apache-2.0Auto-check passedMobile

Install Handle Callback Query

skills CLI
$ npx skills add vendelieu/telegram-bot --skill handle-callback-query -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vendelieu/telegram-bot handle-callback-query --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vendelieu/telegram-bot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/handle-callback-query .claude/skills/handle-callback-query && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
handle-callback-query
GitHub stars
249
Token cost
~824 tokens
SKILL.md length
160 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
Apache-2.0

At a glance

Handles inline keyboard button presses and provides user feedback via answerCallbackQuery.

  • Processing callback queries
  • SKILL.md covers Quick Start, Handler Registration, Accessing Callback Data and Answering the Query, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Answering button clicks

What it does

Handle Callback Query is an agent skill from vendelieu/telegram-bot. Handles inline keyboard button presses and provides user feedback via answerCallbackQuery. Use when processing callback queries, answering button clicks, or updating messages after inline button interaction.

Its SKILL.md is about 820 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering Chatbots and conversational support and Android development. It works with Telegram and Kotlin. The repository describes itself as: Telegram Bot API wrapper with handy Kotlin DSL. The licence is Apache-2.0.

When your agent uses it

  • Processing callback queries
  • Answering button clicks
  • Updating messages after inline button interaction

Example prompts

  • “Use the handle-callback-query skill to handle inline keyboard button presses and provides user feedback via answerCallbackQuery”
  • “/handle-callback-query”

What it can do on your machine

Read from SKILL.md and the folder at commit 1dbfd00. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Handle Callback Query loads about 824 tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 160 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~824

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vendelieu/telegram-bot at commit 1dbfd00, republished under its Apache-2.0 licence (© vendelieu). 160 words, ~824 tokens.

Download SKILL.mdSave it as .claude/skills/handle-callback-query/SKILL.md (or your agent's skills folder).
name
handle-callback-query
description
Handles inline keyboard button presses and provides user feedback via answerCallbackQuery. Use when processing callback queries, answering button clicks, or updating messages after inline button interaction.

Handle Callback Query

Quick Start

Register a handler and always answer the callback query to stop the loading state:

kotlin
bot.setFunctionality {
    onCallbackQuery {
        val cq = update.callbackQuery
        answerCallbackQuery(cq.id).options { text = "Done!" }.send(user, bot)
        when (cq.data) {
            "yes" -> message("You said yes!").send(user, bot)
            "no" -> message("You said no.").send(user, bot)
        }
    }
}

Handler Registration

  • DSL: onCallbackQuery { } — typed ActivityCtx<CallbackQueryUpdate>
  • Annotation: @CommandHandler.CallbackQuery(["prefix"]) with optional autoAnswer = true

Accessing Callback Data

  • update.callbackQuery — the CallbackQuery
  • callbackQuery.id — required for answerCallbackQuery
  • callbackQuery.data — button data (1-64 bytes), may be null
  • callbackQuery.from — user who pressed
  • callbackQuery.message — message with the button (if any)

Answering the Query

Always call answerCallbackQuery to remove the loading state:

kotlin
answerCallbackQuery(callbackQuery.id).send(user, bot)

With options:

kotlin
answerCallbackQuery(callbackQuery.id).options {
    text = "Saved!"           // Notification text (0-200 chars)
    showAlert = true         // Alert instead of top notification
    url = "https://..."      // URL to open (e.g. t.me/bot?start=xxx)
    cacheTime = 60           // Cache result (seconds)
}.send(user, bot)

Parsing Callback Data

Use prefixes for routing: "action:id", "vote:123":

kotlin
cq.data?.split(":", limit = 2)?.let { (action, id) ->
    when (action) {
        "vote" -> handleVote(id.toLong())
        "page" -> showPage(id.toInt())
    }
}

@ParamMapping

Maps handler parameters to keys in the parsed parameters map. Use with @CommandHandler.CallbackQuery when the ArgumentParser extracts named values from callback data (e.g. page=1, id=123):

kotlin
@CommandHandler.CallbackQuery(["vote"], autoAnswer = true)
suspend fun handleVote(
    @ParamMapping("id") itemId: Long,
    user: User,
    bot: TelegramBot
) {
    message("Voted for $itemId").send(user, bot)
}
  • @ParamMapping("name") — parameter is resolved from parameters["name"] (parsed by ArgumentParser)
  • Supported types: String, Int, Long, Short, Float, Double
  • Use when callback data exceeds simple routing and you need typed parameters

Updating the Message

After handling, optionally edit the message or its markup:

  • editMessageText — change text
  • editMessageReplyMarkup — change/remove buttons

Reference

© vendelieu, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/handle-callback-query of vendelieu/telegram-bot.

Open the folder on GitHubat commit 1dbfd00

Compare with similar skills

Handle Callback Query next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Handle Callback Query compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Handle Callback Query this skillvendelieu/telegram-bot249—~824Automated safety check: PassApache-2.0
Compose Multiplatform Patternsmonta-app/ocpp-emulator1805 repos~2kAutomated safety check: PassApache-2.0
Kotlin Patternsgetknit/knit1315 repos~4.7kAutomated safety check: PassGPL-3.0
Summoncodeyousef/summon167—~1.1kAutomated safety check: PassApache-2.0
Add JSON Schemayontrack/yontrack102—~883Automated safety check: PassMIT
CometChat Android v5 Headless SDKcometchat/cometchat-skills130—~4kAutomated safety check: PassMIT

Similar skills

  • Compose Multiplatform Patterns

    monta-app/ocpp-emulator

    Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.

    180 GitHub starsUsed in 5 repos~2k tokens
    MobileAuto-check passed
  • Kotlin Patterns

    getknit/knit

    Idiomatic Kotlin patterns, best practices, and conventions for building robust, efficient, and maintainable Kotlin applications with coroutines, null safety, and DSL builders.

    131 GitHub starsUsed in 5 repos~4.7k tokens
    MobileAuto-check passed
  • Summon

    codeyousef/summon

    A skill your agent uses when developing applications with the Summon Kotlin Multiplatform UI framework.

    167 GitHub stars~1.1k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Add JSON Schema

    yontrack/yontrack

    Add a new downloadable JSON schema to the Resources page — Kotlin provider class only, auto-discovered by Spring.

    102 GitHub stars~883 tokensUpdated today
    MobileAuto-check passed
  • CometChat Android v5 Headless SDK

    cometchat/cometchat-skills

    Builds chat on Android with your own UI against the headless CometChat Chat SDK v5, covering install, Jetifier conflicts, credentials and init-before-login ordering.

    130 GitHub stars~4k tokensUpdated 2 days ago
    MobileAuto-check passed
  • Add Widget

    yontrack/yontrack

    Scaffold a new Yontrack dashboard widget end-to-end — Kotlin AbstractWidget class with config data class, and two frontend components (display + form).

    102 GitHub stars~1.6k tokensUpdated today
    MobileAuto-check passed

More from vendelieu/telegram-bot

All 14 skills in this repo
  • Add Ktnip Ksp Tests

    vendelieu/telegram-bot

    Adds tests for the ktnip KSP processor. An agent skill from vendelieu/telegram-bot.

    249 GitHub stars~726 tokensUpdated 3 days ago
    Auto-check passed
  • Add Ktnip Parameter Strategy

    vendelieu/telegram-bot

    Adds a new parameter resolution strategy to the ktnip KSP processor.

    249 GitHub stars~613 tokensUpdated 3 days ago
    Auto-check passed
  • Add Telegram API Action

    vendelieu/telegram-bot

    Adds a new Telegram Bot API method (action class and top-level functions).

    249 GitHub stars~974 tokensUpdated 3 days ago
    Auto-check passed
  • Add Telegram API Tests

    vendelieu/telegram-bot

    Writes tests for Telegram Bot API actions. An agent skill from vendelieu/telegram-bot.

    249 GitHub stars~609 tokensUpdated 3 days ago
    Auto-check: notes
  • Add Telegram Update Field

    vendelieu/telegram-bot

    Adds a new field to the Update type and wires it through ProcessedUpdate, UpdateType, ProcessUpdate, KSP (TypeConstants, TypeMapper), and FunctionalDSLUtils.

    249 GitHub stars~841 tokensUpdated 3 days ago
    Auto-check passed
  • Add Wizard Handler

    vendelieu/telegram-bot

    Configures @WizardHandler annotation for wizard flows. An agent skill from vendelieu/telegram-bot.

    249 GitHub stars~508 tokensUpdated 3 days ago
    Auto-check passed

Works with

Questions about Handle Callback Query

What does Handle Callback Query do?

Handles inline keyboard button presses and provides user feedback via answerCallbackQuery. Handle Callback Query is an agent skill from vendelieu/telegram-bot. Handles inline keyboard button presses and provides user feedback via answerCallbackQuery.

When should I use Handle Callback Query?

Handle Callback Query fits situations like: processing callback queries; answering button clicks; updating messages after inline button interaction.

How do I install Handle Callback Query in Claude Code?

Run `npx skills add vendelieu/telegram-bot --skill handle-callback-query -a claude-code`. Or copy the skill folder (.cursor/skills/handle-callback-query in vendelieu/telegram-bot) into .claude/skills/handle-callback-query in your project. Claude Code loads it when a task matches its description.

How do I install Handle Callback Query in Codex?

Run `npx skills add vendelieu/telegram-bot --skill handle-callback-query -a codex`. Or copy the skill folder (.cursor/skills/handle-callback-query in vendelieu/telegram-bot) into .agents/skills/handle-callback-query in your project. Codex loads it when a task matches its description.

Can I use Handle Callback Query in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vendelieu/telegram-bot --skill handle-callback-query -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/handle-callback-query, .gemini/skills/handle-callback-query, .github/skills/handle-callback-query and .opencode/skills/handle-callback-query in your project.

What does Handle Callback Query need to run?

SKILL.md names no scripts, command-line tools or credentials: Handle Callback Query is instructions for the agent only.

Does Handle Callback Query access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Handle Callback Query safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Handle Callback Query use?

Handle Callback Query is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Handle Callback Query use?

About 824 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Handle Callback Query?

Skills that share tags, products or a category with Handle Callback Query: Compose Multiplatform Patterns (monta-app/ocpp-emulator, 180 stars), Kotlin Patterns (getknit/knit, 131 stars), Summon (codeyousef/summon, 167 stars) and Add JSON Schema (yontrack/yontrack, 102 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Handle Callback Query?

vendelieu (a GitHub user) maintains it in vendelieu/telegram-bot, which has 249 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 4, 2026.

Source: vendelieu/telegram-bot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.