Git Product home page Git Product logo

grammy-bot-framework's Introduction

grammY

The Telegram Bot Framework.

grammY makes it easy to create Telegram bots. Both for beginners and at scale.

You want grammY because it is easy to use. It is very powerful and always up to date. It has the best documentation in town. It is extremely efficient and scales up effortlessly. It has a thriving ecosystem of plugins, a friendly community chat, seamless integrations with web frameworks and databases, and so much more.

Are you ready? πŸ€–πŸš€

Bots are written in TypeScript (or JavaScript) and run on Node.js or Deno.

Quickstart

If you are new to Telegram bots, read the official Introduction for Developers written by the Telegram team.

Visit @BotFather and create a new bot. You will obtain a bot token.

Create a new directory and run

npm install grammy

inside it. Then create a file bot.js with this content:

const { Bot } = require("grammy");

// Create a bot object
const bot = new Bot(""); // <-- place your bot token in this string

// Register listeners to handle messages
bot.on("message:text", (ctx) => ctx.reply("Echo: " + ctx.message.text));

// Start the bot (using long polling)
bot.start();

Now you can run the bot via

node bot.js

and it will echo all received text messages.

Congrats! You just wrote a Telegram bot :)

Going Further

grammY has an excellent documentation, and an API Reference. It even integrates with your code editor, e.g. VSCode. You can hover over any element of grammY to get a detailed description of what that thing does or means.

If you are still stuck, just join the Telegram chat and ask for help. People are nice there and we appreciate your question, no matter what it is :)

Here are some more resources to support you:

Resources

β€”main project website and documentation. Gets you started and explains all concepts.

β€”reference of everything that grammY exports. Useful to look up descriptions about any element of grammY.

β€”repository full of example bots. Includes a setup to easily run any of them.

β€”list of awesome projects built with grammY. Helpful if you want to see some real-world usage.

β€”Telegram chat where you can ask any question about grammY or bots in general. We are also open for feedback, ideas, and contributions!

The Russian community chat can be found here.

β€”Telegram channel where updates to grammY and the ecosystem are posted. We are also on Twitter.

β€”documentation of the API that Telegram offers, and that grammY connects to under the hood.

Deno Support

All grammY packages published by @grammyjs run natively on Deno. We are compiling every codebase to still run on Node.js.

However, given that most bot developers are still using Node.js, all documentation is written Node.js-first. We may migrate it if Deno overtakes Node.js. If you are already on Deno today, import grammY from https://deno.land/x/grammy/mod.ts.

You may also be interested in why we support Deno.

Browser Support

The grammY core package in this repository is available as a JavaScript bundle from the CDN at get.grammy.dev. Currently, we transpile all stable versions (all releases since v1.0) as well as the current main branch to ES6 and ESNext.

You can download them from the URL https://get.grammy.dev/[ES version lowercased]@[grammY version including v-prefix].js. For example, the most recent source on main in ES6 is available from https://get.grammy.dev/[email protected].

So far, this is mainly useful for running bots on Cloudflare Workers.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

KnorpelSenf
KnorpelSenf

πŸ€” πŸ’» πŸ“– 🎨 πŸ’‘ ⚠️ πŸ”Œ πŸ“¦ πŸ‘€ πŸ§‘β€πŸ« πŸ“† πŸš‡
Heero
Heero

πŸ”Œ πŸ““ πŸ’‘ πŸ“– πŸ‘€ πŸ’» πŸ€”
Wojciech Pawlik
Wojciech Pawlik

πŸ€” πŸ‘€ πŸš‡ πŸ“¦ πŸ”§
Alessandro Bertozzi
Alessandro Bertozzi

πŸ“–
trgwii
trgwii

πŸ’» πŸ‘€
KnightNiwrem
KnightNiwrem

πŸ’» πŸ› πŸ”Œ πŸ“– πŸ’‘ πŸ‘€ πŸ§‘β€πŸ«
Muthu Kumar
Muthu Kumar

πŸ‘€
EdJoPaTo
EdJoPaTo

πŸ”Œ πŸ“– πŸ€” πŸ‘€ πŸ› πŸ’»
Amir Zouerami
Amir Zouerami

πŸ“– πŸ”Œ πŸ’‘
Roj
Roj

πŸ“– πŸ‘€ πŸš‡ 🌍 πŸ’» πŸ€” πŸ§‘β€πŸ« πŸ’‘
jokasimr
jokasimr

πŸ›
Ciki Momogi
Ciki Momogi

πŸ“–
AndreoliBR
AndreoliBR

πŸ‘€
Kirill Loskutov
Kirill Loskutov

πŸ“– πŸ› πŸ€” 🎨 πŸ’¬ πŸ‘€ πŸ’» πŸ”Œ
Andrew Lane
Andrew Lane

πŸ› πŸ‘€
code-withAshish
code-withAshish

πŸ“– πŸ’¬
Stephane Mensah
Stephane Mensah

πŸ› πŸ”Œ
Asaku01
Asaku01

πŸ“–
ppsimn
ppsimn

πŸ›
Satont
Satont

πŸ”Œ πŸ“–
deptyped
deptyped

πŸ’‘ πŸ“– βœ…
Jacek Nowacki
Jacek Nowacki

πŸ“– πŸ’» πŸ› πŸ‘€ πŸ€”
Outvi V
Outvi V

πŸ’»
Ikko Ashimine
Ikko Ashimine

πŸ“–
Yevhen Denesiuk
Yevhen Denesiuk

πŸ‘€ πŸ› πŸ’»
prastian
prastian

πŸ› πŸ’»
Sayem Chowdhury
Sayem Chowdhury

πŸ€”
kospra
kospra

πŸ€” πŸ’»
Chimit
Chimit

πŸ“–
Calsi
Calsi

πŸ“–
Jonas Zohren
Jonas Zohren

πŸ› πŸ’»
linbuxiao
linbuxiao

πŸ“– 🌍
JiquanWang99
JiquanWang99

πŸ“– 🌍
Borhan Hafez
Borhan Hafez

πŸ”Œ
WingLim
WingLim

πŸ“– 🌍 πŸ’» πŸ”Œ πŸ€”
taotie111
taotie111

πŸ“– 🌍
Merlin
Merlin

πŸ“–
Darvesh
Darvesh

πŸ› πŸ’» πŸ‘€
dcdunkan
dcdunkan

πŸ› πŸ’» πŸ”Œ πŸ‘€ πŸ“– πŸ€” πŸš‡ πŸ”§
Kid
Kid

πŸ“– 🌍
Slava Fomin II
Slava Fomin II

πŸ› πŸ“–
Kiko Beats
Kiko Beats

πŸ“–
Vsevolod
Vsevolod

πŸ’» πŸ€” πŸ‘€
Habemuscode
Habemuscode

πŸ‘€ πŸ“– 🌍
Nikita Kolmogorov
Nikita Kolmogorov

πŸ”Œ
Vitaliy Meshchaninov
Vitaliy Meshchaninov

πŸ› πŸ’»
Дилян ΠŸΠ°Π»Π°ΡƒΠ·ΠΎΠ²
Дилян ΠŸΠ°Π»Π°ΡƒΠ·ΠΎΠ²

πŸ› πŸ’»
lmx-Hexagram
lmx-Hexagram

πŸ“–
Ilya Semenov
Ilya Semenov

πŸ€” πŸ‘€ πŸ’»
abdollahzadehAli
abdollahzadehAli

πŸ“– πŸ’‘
Saeed Nasiri
Saeed Nasiri

πŸ“–
Hesoyam
Hesoyam

πŸ“–
yrzam
yrzam

πŸ›
drmikecrowe
drmikecrowe

πŸ‘€
Martin
Martin

πŸ“– πŸ› πŸ‘€
Pavel
Pavel

πŸ’‘
Thor ι›·η₯ž Schaeff
Thor ι›·η₯ž Schaeff

πŸ’‘
x066it
x066it

πŸ› πŸ‘€
kolay
kolay

πŸ‘€
Evgeny Nepomnyashchiy
Evgeny Nepomnyashchiy

πŸ‘€
Ananta Krsna dasa
Ananta Krsna dasa

πŸ“–
Mighty Ali
Mighty Ali

πŸ’» πŸ‘€ πŸ€”
δΈ‰δΈ‰
δΈ‰δΈ‰

πŸ› πŸ’»
Roz
Roz

πŸ› πŸ’» πŸ‘€ πŸš‡ πŸ€”
Dani Haro
Dani Haro

πŸ’» πŸ”Œ πŸ“–
Ryukaizen
Ryukaizen

πŸ“–
Alisher Ortiqov
Alisher Ortiqov

πŸ“–
Tony Tkachenko
Tony Tkachenko

πŸ“–
Ra
Ra

πŸ’»
sartoshi-foot-dao
sartoshi-foot-dao

πŸ“–
Yoel Navas E.
Yoel Navas E.

πŸ€”
Vitor Gomes
Vitor Gomes

πŸ› πŸ’»
Aditya
Aditya

πŸ› πŸ‘€
Udit Karode
Udit Karode

πŸ‘€
Mike RockΓ©tt
Mike RockΓ©tt

πŸ‘€
Srinivasa IK Varanasi
Srinivasa IK Varanasi

πŸ’»
abdoo9
abdoo9

πŸ› πŸ’»
ak4zh
ak4zh

πŸ‘€ πŸ€” πŸ’»
Nikolay Lapshin
Nikolay Lapshin

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

grammy-bot-framework's People

Contributors

knorpelsenf avatar allcontributors[bot] avatar roj1512 avatar roziscoding avatar knightniwrem avatar loskir avatar dzek69 avatar darvesh avatar edjopato avatar eltociear avatar ilyasemenov avatar jfowl avatar habemuscode avatar c0rn3j avatar outloudvi avatar waptik avatar tonytkachenko avatar glukki avatar vitorleo avatar kraftwerk28 avatar wojpawlik avatar abdoo9 avatar ak4zh avatar dcdunkan avatar kospra avatar oott123 avatar

Stargazers

Serhii Shyran avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.