Skip to content

Commit

Permalink
fix: no bot username config (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
niracler committed Jan 25, 2024
1 parent 04d031a commit 3ec7f55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function handler(update: TelegramUpdate, env: Env): Promise<string | undef
} else if (content.startsWith('/ping')) {
return await processPingCommand(update, env)

} else if (content.includes(`@${env.TELEGRAM_BOT_USERNAME}`) && !content.startsWith('/')) {
} else if (env.TELEGRAM_BOT_USERNAME && content.includes(`@${env.TELEGRAM_BOT_USERNAME}`) && !content.startsWith('/')) {
return await processLLM(update, env)

} else if (content.startsWith('/sync_twitter')) {
Expand Down
2 changes: 1 addition & 1 deletion wrangler.demo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ compatibility_flags = [ "nodejs_compat" ]

[vars]
ALLOW_USER_IDS = [ ]
TELEGRAM_BOT_USERNAME = ''
TELEGRAM_BOT_USERNAME = 'YOUR_BOT_USERNAME'

[[d1_databases]]
binding = "DB" # i.e. available in your Worker on env.DB
Expand Down

0 comments on commit 3ec7f55

Please sign in to comment.