Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vlad-iakovlev/grammy-reply-with-markdown
replyWithMarkdown method for grammY
https://github.com/vlad-iakovlev/grammy-reply-with-markdown
Last synced: about 2 months ago
JSON representation
replyWithMarkdown method for grammY
- Host: GitHub
- URL: https://github.com/vlad-iakovlev/grammy-reply-with-markdown
- Owner: vlad-iakovlev
- License: mit
- Created: 2022-08-12T11:55:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-09T00:11:38.000Z (about 2 months ago)
- Last Synced: 2024-11-09T20:32:48.452Z (about 2 months ago)
- Language: TypeScript
- Size: 837 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grammy-reply-with-markdown
replyWithMarkdown method for grammY. Uses [@vlad-yakovlev/telegram-md](https://www.npmjs.org/package/@vlad-yakovlev/telegram-md)
![GitHub CI](https://img.shields.io/github/actions/workflow/status/vlad-iakovlev/grammy-reply-with-markdown/ci.yml?branch=main&label=github-ci)
[![Codecov](https://img.shields.io/codecov/c/github/vlad-iakovlev/grammy-reply-with-markdown/main)](https://codecov.io/gh/vlad-iakovlev/grammy-reply-with-markdown)
[![NPM](https://img.shields.io/npm/v/@vlad-yakovlev/grammy-reply-with-markdown)](https://www.npmjs.org/package/@vlad-yakovlev/grammy-reply-with-markdown)## Table of Contents
1. [How to Install](#how-to-install)
2. [Usage Examples](#usage-examples)## How to install
```sh
npm install @vlad-yakovlev/grammy-reply-with-markdown
```## Usage Examples
```ts
import { Bot, Context } from 'grammy';
import { ReplyWithMarkdownFlavour, replyWithMarkdownPlugin } from '@vlad-yakovlev/grammy-reply-with-markdown';
import { md } from 'telegram-md';(async () => {
const bot = new Bot('');bot.use(replyWithMarkdownPlugin());
bot.command('start', async (ctx) => {
// Send simple string (all special characters will be escaped)
await ctx.replyWithMarkdown('Hello, World!');// Send Markdown (read more about `md` here: https://www.npmjs.org/package/telegram-md)
await ctx.replyWithMarkdown(md`Hello, ${md.bold(World)}!`);// Options will be passed to ctx.reply
await ctx.replyWithMarkdown('foo-bar', { reply_markup: { keyboard: [] });
});
})()
```