Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 3.63 KB

README.md

File metadata and controls

57 lines (37 loc) · 3.63 KB

Reddit AutoPoster Bot

A simple Autoposter Telegram bot written using Grammy Framework in Typescript and using Mongo database. This bot let users to subscribe to a specific subreddit and automatically posts new submissions to a designated channel. The bot is designed to run continuously, checking for new posts at a regular interval and posting them to the channel using the Telegram API.

Setup

Local Hosting

To get started, clone this repository to your local machine and navigate to the project directory using below command

git clone https://github.com/TAMILVIP007/RedditBot.git && cd RedditBot

Before running the bot, you will need to configure it with your Telegram API key, the subreddit you want to monitor, and the channel you want to post to. To do this, create a .env file in the project directory and add the following lines:

TOKEN=<your Telegram bot token>
DB_URL=<your database URL>
DEVS=<comma-separated list of developer Telegram IDs>
WEBHOOK_PATH=<your webhook path>
PORT=<port number>

Replace <your Telegram bot token> with your actual Telegram bot token, <your database URL> with the URL of your database, <comma-separated list of developer Telegram IDs> with a comma-separated list of Telegram IDs for developers who should receive error messages, <your webhook path> with the path to your webhook URL, and <port number> with the port number to listen on.

Usage

Webhook

To start the bot using a webhook, run the following command in the project directory:

deno task start

Polling

To host the bot using polling, run the following command in the project directory:

deno task local 

This will start the bot and bot in polling mode

Deno Deploy

Deploy Now!

1. Open Deno Deploy, create a new project.
2. Fork this repo.
3. Search for this repo on deno deploy, set branch as deno, set file asmain.ts
4. Add your environment vars DB_URL, DEVS, WEBHOOK_PATHand click "Link".
5. Once done, open the deployment page, copy deployment URL, set your bot's webhook using https://api.telegram.org/bot/setWebhook?url=deployment_url_here?token=your_bot_token_here.

Contributing

If you would like to contribute to this project, please fork the repository and submit a pull request with your changes. Contributions are always welcome and appreciated!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an actionof contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.