Code Monkey home page Code Monkey logo

poster-bot's Introduction

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

poster-bot's People

Contributors

mikefromru avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.