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 79 2

  2. documentation documentation Public

    GramIO framework documentation

    TypeScript 4 3

  3. types types Public

    Code-generated and Auto-published Telegram Bot API types

    TypeScript 9 1

Repositories

Showing 10 of 25 repositories
  • create-gramio Public

    Scaffolding your GramIO project with the environment with easy!

    gramiojs/create-gramio’s past year of commit activity
    TypeScript 3 0 2 7 Updated Dec 29, 2024
  • scenes Public

    WIP

    gramiojs/scenes’s past year of commit activity
    TypeScript 3 MIT 0 0 0 Updated Dec 29, 2024
  • documentation Public

    GramIO framework documentation

    gramiojs/documentation’s past year of commit activity
    TypeScript 4 3 0 0 Updated Dec 29, 2024
  • gramio Public

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

    gramiojs/gramio’s past year of commit activity
    TypeScript 79 MIT 2 0 0 Updated Dec 26, 2024
  • contexts Public
    gramiojs/contexts’s past year of commit activity
    TypeScript 2 MIT 0 0 0 Updated Dec 26, 2024
  • storages Public

    Storage adapters for GramIO

    gramiojs/storages’s past year of commit activity
    TypeScript 3 0 0 0 Updated Dec 26, 2024
  • keyboards Public

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

    gramiojs/keyboards’s past year of commit activity
    TypeScript 5 MIT 0 0 0 Updated Dec 21, 2024
  • wrappergram Public

    Simple and tiny code-generated Telegram Bot API wrapper for TypeScript/JavaScript with file upload support.

    gramiojs/wrappergram’s past year of commit activity
    TypeScript 4 MIT 0 0 0 Updated Dec 21, 2024
  • files Public

    Library for uploading files to Telegram and etc with files

    gramiojs/files’s past year of commit activity
    TypeScript 4 MIT 0 0 0 Updated Dec 21, 2024
  • .github Public
    gramiojs/.github’s past year of commit activity
    2 0 0 0 Updated Dec 18, 2024

People

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

Top languages

Loading…

Most used topics

Loading…