Download this extension from the Visual Studio Code Marketplace
Here's the full list of all the snippets:
const { Telegraf } = require("telegraf");
const app = new Telegraf();
app.launch();
process.once("SIGINT", () => app.stop("SIGINT"));
process.once("SIGTERM", () => app.stop("SIGTERM"));
import { Telegraf } from "telegraf";
const app = new Telegraf();
app.launch();
process.once("SIGINT", () => app.stop("SIGINT"));
process.once("SIGTERM", () => app.stop("SIGTERM"));
app.command("", (ctx) => {
// your code here
});
app.command("", async (ctx) => {
// your code here
});
app.on("", (ctx) => {
// your code here
});
app.on("", async (ctx) => {
// your code here
});
app.on("text", (ctx) => {
// your code here
});
app.on("text", async (ctx) => {
// your code here
});
app.on("callback_query", (ctx) => {
// your code here
});
app.on("callback_query", async (ctx) => {
// your code here
});
app.on("inline_query", (ctx) => {
// your code here
});
app.on("inline_query", async (ctx) => {
// your code here
});
const someScene = new Scenes.BaseScene<Scenes.SceneContext>("some");
someScene.enter((ctx) => {
// your code here
});
const someScene = new Scenes.BaseScene<Scenes.SceneContext>("some");
someScene.enter(async (ctx) => {
// your code here
});
const stage = new Scenes.Stage<Scenes.SceneContext>([]);
const stage = new Scenes.Stage<Scenes.SceneContext>([], {
ttl: 10,
});
const someWizard = new Scenes.WizardScene(
"some-wizard",
(ctx) => {
// your code here
}
);
const someWizard = new Scenes.WizardScene(
"some-wizard",
async (ctx) => {
// your code here
}
);
const stage = new Scenes.Stage<Scenes.WizardContext>([], {
default: "-wizard",
});
return ctx.wizard.next();
(ctx) => {
// your code here
};
async (ctx) => {
// your code here
};