Skip to content

Instantly share code, notes, and snippets.

function handler(req: Request): Response {
return new Response(`Hello, ${req.url}`);
}
Deno.serve({
port: 0
}, handler);
@sevapp
sevapp / deno-telegram-mailer.ts
Last active October 1, 2023 14:22
Safe message sending script in Telegram with just 49 lines of code
import fetchify from "https://deno.land/x/fetchify@0.2.8/mod.ts";
export class TelegramMailer {
private tgApi;
private queue: Deno.Kv = undefined as unknown as Deno.Kv;
constructor(token: string) {
this.tgApi = fetchify.create({
baseURL: `https://api.telegram.org/bot${token}/`,
limiter: {