Skip to content
@gramiojs

GramIO

TypeScript/JavaScript Telegram Bot API Framework for create your bots with convenience!

GramIO

Bot API npm JSR JSR Score

TypeScript/JavaScript Telegram Bot API Framework for create your bots with convenience!

Extensible - Our plugin and hook system is awesome

🛡️ Type-safe - Written in TypeScript with love ❤️

🌐 Multi-runtime - Works on Node.js, Bun and Deno

⚙️ Code-generated - Many parts are code-generated (for example, code-generated and auto-published Telegram Bot API types)

To create your new bot, you just need to write it to the console:

npm create gramio@latest ./bot

and GramIO customize your project the way you want it!

Example

import { Bot } from "gramio";

const bot = new Bot(process.env.BOT_TOKEN as string)
    .command("start", (context) => context.send("Hello!"))
    .onStart(({ info }) => console.log(`✨ Bot ${info.username} was started!`));

bot.start();

For more, please see documentation and get-started guide.

GramIO in action

Example which uses some interesting features.

import { Bot, format, bold, code } from "gramio";
import { findOrRegisterUser } from "./utils";

const bot = new Bot(process.env.BOT_TOKEN as string)
    .derive("message", async () => {
        const user = await findOrRegisterUser();

        return {
            user,
        };
    })
    .on("message", (context) => {
        context.user; // typed

        return context.send(format`
        Hi, ${bold(context.user.name)}! 
        You balance: ${code(context.user.balance)}`);
    });

Pinned Loading

  1. gramio gramio Public

    Powerful, extensible and really type-safe Telegram Bot API framework

    TypeScript 61 1

  2. documentation documentation Public

    GramIO framework documentation

    TypeScript 3 3

  3. types types Public

    Code-generated and Auto-published Telegram Bot API types

    TypeScript 8 1

Repositories

Showing 10 of 23 repositories
  • create-gramio Public

    Scaffolding your GramIO project with the environment with easy!

    gramiojs/create-gramio’s past year of commit activity
    TypeScript 2 0 2 4 Updated Nov 14, 2024
  • documentation Public

    GramIO framework documentation

    gramiojs/documentation’s past year of commit activity
    TypeScript 3 3 0 0 Updated Nov 10, 2024
  • scenes Public

    WIP

    gramiojs/scenes’s past year of commit activity
    TypeScript 0 MIT 0 0 0 Updated Nov 10, 2024
  • gramio Public

    Powerful, extensible and really type-safe Telegram Bot API framework

    gramiojs/gramio’s past year of commit activity
    TypeScript 61 MIT 1 0 0 Updated Nov 8, 2024
  • .github Public
    gramiojs/.github’s past year of commit activity
    2 0 0 0 Updated Nov 2, 2024
  • types Public

    Code-generated and Auto-published Telegram Bot API types

    gramiojs/types’s past year of commit activity
    TypeScript 8 MIT 1 0 0 Updated Nov 2, 2024
  • keyboards Public

    Framework-agnostic Telegram bot keyboard builder with many cool features!

    gramiojs/keyboards’s past year of commit activity
    TypeScript 4 MIT 0 0 0 Updated Nov 2, 2024
  • i18n Public

    This plugin provide good way to add internationalization for your bots!

    gramiojs/i18n’s past year of commit activity
    TypeScript 3 MIT 0 0 0 Updated Oct 26, 2024
  • format Public

    Library for formatting text for Telegram Bot API

    gramiojs/format’s past year of commit activity
    TypeScript 2 MIT 0 0 0 Updated Oct 11, 2024
  • files Public

    Library for uploading files to Telegram and etc with files

    gramiojs/files’s past year of commit activity
    TypeScript 3 MIT 0 0 0 Updated Sep 22, 2024

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

TypeScript