
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Telegram bot library for interactive panels
Keygram provides wrappers for Telegram’s callback queries, making it easier to create interactive panels.
In the near future, I plan to add media caching, a plugin system, and enhanced inline_query support.
Tested in Bun and Node ecosystems, JavaScript and TypeScript
callback_query is processed.new TelegramBot({ token, signCallbacks: false })ctx.edit() to edit both text and file captions. No more separate bot.editMessageText or bot.editMessageCaption calls!ctx.respond() will either send a new message or edit the existing one (if triggered by a callback button)There are more features and they will be documented soon. For now, you can look at examples!
Install using your preferred package manager:
# With Bun
bun add keygram
# With npm
npm install keygram
# With yarn
yarn add keygram
import { TelegramBot, Panel } from "keygram"
const bot = new TelegramBot("YOUR_TOKEN")
/* Example: function is pre-defined */
const clicked = (ctx, amount = 0) => {
const btnText = "✨ Button clicked " + amount + " times"
const keyboard = Panel().Callback(btnText, clicked, amount + 1)
// Use ctx.edit() to edit the message, or ctx.reply() to send a new one
ctx.edit(`You clicked <b>the button!</b>`, keyboard)
}
const mainMenu = Panel().Callback("✨ Click me!", clicked)
.Row()
.Button("Dummy button") // No callback_data needed
bot.on('/start', ctx => ctx.reply(`Welcome, <b>${ctx.from.first_name}</b>!`, mainMenu))
bot.setParser('HTML')
bot.startPolling()
Pagination functions can be asynchronous, but in this example it's not using that.
import { TelegramBot, Panel, Text, Pagination } from "keygram";
const bot = new TelegramBot("YOUR_TOKEN");
const data = [1, 2, 3, 4, 5, 6, 7].map(x => ({ number: Math.random() }))
const exampleText = (ctx, data, page) =>
`Your personal numbers PikiWedia\nYou're on page ${page+1}/${ctx.maxPage}!`
// If you want to display a slice (for example, 5 elements out of 100) then
// return an array like: [ data_slice_array, total_entries_amount ]
// If you return e.g 7 out of 7 elements, then just return an array of data:
const exampleData = (ctx, page) => data
const exampleKeys = (_, data, page) =>
Panel().Add(data.map(({ number }) => [ Text("Float " + number.toFixed(4)) ]))
const close = ctx => ctx.delete()
const closeKeys = ctx => Panel().Callback("Close panel", close)
const pages = new Pagination("numbers").Text(exampleText)
.Data(exampleData)
.Keys(exampleKeys)
.AfterKeys(closeKeys)
.PageSize(3)
bot.on('/start', ctx => ctx.open(pages));
bot.startPolling()
FAQs
Unknown package
We found that keygram demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.