Observed since 20 Oct, 18:05 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
[](https://www.npmjs.com/package/cfworker-middware-telegraf)
Make telegraf (a telegram bot framework) useable in Cloudflare Workers.
npm i cfworker-middware-telegraf
// index.js
const { Telegraf } = require('telegraf');
const { Application, Router } = require('@cfworker/web');
const createTelegrafMiddware = require('cfworker-middware-telegraf');
const bot = new Telegraf('BOT_TOKEN');
// Your code here, but do not `bot.launch()`
const router = new Router();
router.post('/SECRET_PATH', createTelegrafMiddware(bot));
new Application().use(router.middleware).listen();
// webpack.config.js
module.exports = {
target: 'webworker',
entry: './index.js',
mode: 'production',
node: {
fs: 'empty',
},
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
],
},
performance: {
hints: false,
},
};
Just copy and paste built code to cfworker online editor and save.
Or you can use Wrangler, an official CLI tool, so you don't need to copy and paste code manually anymore. But I don't like it due to its inexplicable bugs on Win10.
These codes only need to be run once locally.
const Telegraf = require('telegraf');
const bot = new Telegraf('BOT_TOKEN');
// set webhook
bot.telegram.setWebhook('https://your.cfworker.domain/SECRET_PATH');
// delete webhook
// bot.telegram.deleteWebhook();
// get webhook info
// bot.telegram.getWebhookInfo().then(console.log);
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.1.7Registry latest | 2 Mar 2021 | 0 | |
| 1.1.6 | 2 Mar 2021 | 0 | |
| 1.1.5 | 2 Mar 2021 | 0 | |
| 1.1.4 | 2 Mar 2021 | 0 | |
| 1.1.3 | 2 Mar 2021 | 0 | |
| 1.1.2 | 2 Mar 2021 | 0 | |
| 1.1.1 | 2 Mar 2021 | 0 | |
| 1.0.9 | 1 Mar 2021 | 0 | |
| 1.0.8 | 1 Mar 2021 | 0 | |
| 1.0.7 | 1 Mar 2021 | 0 | |
| 1.0.6 | 1 Mar 2021 | 0 | |
| 1.0.5 | 1 Mar 2021 | 0 | |
| 1.0.4 | 1 Mar 2021 | 0 | |
| 1.0.3 | 27 Feb 2021 | 0 | |
| 1.0.2 | 27 Feb 2021 | 2 | |
| 1.0.1 | 27 Feb 2021 | 2 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:05 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:fc380dd6df3526d98f5f73f0dce38aa792ff84718c2100573d346cb1e12c0d1b