Skip to content

Latest commit

 

History

History
53 lines (45 loc) · 2.77 KB

README.md

File metadata and controls

53 lines (45 loc) · 2.77 KB

DEMOCaptchaAntiSpam

Serverless Telegram bot on Google infrastructure using Google App Script Telegram Bot Wrapper .

This bot is developed to fight spammers/userbot in public group. Meant to be used on single public group and self-hosted on your own Google account.

DEMO

Setup

  1. Go to script.google.com/start to open the script editor.
  2. Delete any code in the script editor and paste in the code.
  3. Create two (2) new Google Spreadsheets and DO NOT change anything in there.
  4. Replace the constants tgBotToken, botSheet, loggerSheet (line 1-3) with your own.
  5. Click on the menu item Libraries and add BetterLog script ID 1DSyxam1ceq72bMHsE6aOVeOl94X78WCwiYPytKi7chlg4x5GqiNXSw0l
  6. Choose a version in the dropdown box (usually best to pick the latest version).
  7. Add our core library Nahfar script ID 1dPQyiqL_uRGhDvZtgDOEf-RoDdgMtZx6KjfBf-Zzty3HtXp9TuctHET6
  8. Choose a version in the dropdown box (usually best to pick the latest version).
  9. Save your new script.
  10. Click Deploy and select New Deployment.
  11. Select Type as Web app.
  12. Under execute the app as (Execute as), select your account.
  13. Under Who has access to the app, select Anyone.
  14. Click Deploy.
  15. Copy the URL labeled Web app URL.
  16. Replace the constant webAppURL in the script (need to do this on every new deploy).
  17. Replace the constant botHandlerName in the script with your own bot handler.
  18. Run setWebHook function (need to do this on every new deploy).
  19. Run oneTimeSetup function (only do this once).
  20. Run scheduler function (only do this once).
  21. Now your Telegram bot is up and running.

Current bot commands

  • /start payload
  • /whoami

Quota for the Google Apps Script

Feature Consumer and G Suite free edition (legacy) Google Workspace accounts
Script runtime 6 min / execution 6 min / execution
Custom function runtime 30 sec / execution 30 sec / execution
Simultaneous executions 30 30
Triggers 20 / user / script 20 / user / script
Triggers total runtime 90 min / day 6 hr / day
URL Fetch calls 20,000 / day 100,000 / day
URL Fetch response size 50 MB / call 50 MB / call
URL Fetch headers 100 / call 100 / call
URL Fetch headers size 8 KB / call 8 KB / call
URL Fetch POST size 50 MB / call 50 MB / call
URL Fetch URL length 2 KB / call 2 KB / call
Properties read/write 50,000 / day 500,000 / day

Source: Quotas for Google Services