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.
To start the bot using a webhook, run the following command in the project directory:
deno task start
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
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_PATH
and 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
.
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!
This project is licensed under the MIT License - see the LICENSE
file for details.
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.