We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4f1c7b commit 828ce2eCopy full SHA for 828ce2e
src/index.ts
@@ -1,17 +1,17 @@
1
import TelegramBot, { TelegramExecutionContext } from '@codebam/cf-workers-telegram-bot';
2
3
interface Environment {
4
- TOKEN: string;
+ SECRET_TELEGRAM_API_TOKEN: string;
5
}
6
7
export default {
8
async fetch(request: Request, env: Environment, ctx: ExecutionContext): Promise<Response> {
9
- const bot = new TelegramBot(env.TOKEN);
+ const bot = new TelegramBot(env.SECRET_TELEGRAM_API_TOKEN);
10
await bot
11
- .on('start', async function (context: TelegramExecutionContext) {
+ .on('start', async function(context: TelegramExecutionContext) {
12
switch (context.update_type) {
13
case 'message':
14
- await context.reply('Hello World');
+ await context.reply('Hello World 2');
15
break;
16
17
default:
0 commit comments