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 67 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 24 repositories
  • documentation Public

    GramIO framework documentation

    gramiojs/documentation’s past year of commit activity
    TypeScript 3 3 0 0 Updated Nov 30, 2024
  • gramiojs/auto-answer-callback-query’s past year of commit activity
    TypeScript 0 MIT 0 0 0 Updated Nov 30, 2024
  • 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 10 Updated Nov 29, 2024
  • gramio Public

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

    gramiojs/gramio’s past year of commit activity
    TypeScript 67 MIT 1 0 0 Updated Nov 29, 2024
  • .github Public
    gramiojs/.github’s past year of commit activity
    2 0 0 0 Updated Nov 29, 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 Nov 29, 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 29, 2024
  • storages Public

    Storage adapters for GramIO

    gramiojs/storages’s past year of commit activity
    TypeScript 2 0 0 0 Updated Nov 27, 2024
  • scenes Public

    WIP

    gramiojs/scenes’s past year of commit activity
    TypeScript 0 MIT 0 0 0 Updated Nov 27, 2024
  • media-group Public

    Media group collector plugin for GramIO

    gramiojs/media-group’s past year of commit activity
    TypeScript 1 MIT 0 0 0 Updated Nov 24, 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…