Skip to content

This is Telegram bot that posts the news and memes in Telegram channels

Notifications You must be signed in to change notification settings

mikefromru/poster-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poster Bot

Welcome to poster-bot

Poster Bot is about Telegram bot. It is totally asynchronous. This bot posts in two channels. From Reddit it gets some Subreddits only Top posts every about 2 hours then put it on memes Telegram channel. Also this bot get some news from RSS then put the news on news Telegram channel.

Tech

Poster-bot uses a number of open source projects to work properly:

  • Python - interpreted, object-oriented, high-level programming language!
  • Asyncio - library to write concurrent code using the async/await syntax.
  • Aiogram - modern and fully asynchronous framework for Telegram Bot.
  • Aiohttp - HTTP client/server for asyncio.
  • BeautifulSoup4 - library for pulling data out of HTML and XML files.
  • Asyncpraw - python package that allows for simple access to Reddit's API.

Set the environment variables in the .env file (Required variables are given below for development)

# Telegram token
BOT_TOKEN=

# Channal IDS
HUMOR_CHAT_ID=
NEWS_CHAT_ID=
USER_ID=

# Reddit enviroment variabels
CLIENT_ID=
CLIENT_SECRET=
REDIRECT_URI=

Make a python file memes/local_tools.py

lst_subreddits = ['<name-of-your-subreddit_1>','<name-of-your-subreddit_2>']

Installation

Poster-bot requires Python v3+ to run.

Install the dependencies and run the bot.

cd poster-bot
pip install -r requirements.txt
python main.py

Docker

Poster Bot is very easy to install and deploy in a Docker container.

cd poster-bot
docker build -t poster .

This will create the poster image and pull in the necessary dependencies. Now you can run the Docker image.

docker run -d poster

Now you can run the bot commands in the bot

Run posting news

/post_news

Run posting memes

/post_memes

About

This is Telegram bot that posts the news and memes in Telegram channels

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published