This is a Telegram bot designed to filtering spam messages.
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
You can start editing the spam patterns regexp by modifying src/spamPatterns.ts
.
See .env.example
file what enviroment variables to set up need.
This project uses @netlify/plugin-nextjs
plugin.
Just add the new site in netlify dashboard from your git repository.
Check out our Next.js deployment documentation for more details.
For the bot to work, you need to set a webhook, for this you can call the following command:
curl https://{HOST}/api/{TELEGRAM_BOT_TOKEN}/setup
Where: {HOST}
equals to your enviroment variable HOST
value and {TELEGRAM_BOT_TOKEN}
equals to your enviroment variable TELEGRAM_BOT_TOKEN
value.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!