Skip to content

Telegram-CMS (Content Management System) based on Django Framework and Aiohttp.

License

Notifications You must be signed in to change notification settings

mazurolegdev/telegram-cms

Repository files navigation

Telegram-CMS v.0.3.2 alpha

img

Instruments:

Short feature list:

  • It works with bot's and user's accounts
  • It can parse all account groups and channels
  • It can parse all account contacts and dialogs
  • It can talk with users using Triggers System
  • It can broadcast any posts of any channels and groups to your channel or your contact. Even if you are not a admin of parsed group.
  • It can broadcast content from any groups and channels to any groups and channels with Group Listeners. Even if you are not a admin of parsed group. [need fix]
  • It can broadcast content from RSS Feeds to any groups and channels with RSS Listeners. Even if you are not a admin of parsed group. [need fix]
  • It can schedule content to any groups and channels. Even if you are not a admin of parsed group. [need fix]
  • It got handle API for 90% of features. [not started yet]
  • It can handle API for Text Recognitions. [not started yet]
  • It can make visit statistics for any groups and channels you want. [not started yet]
  • It can make sales statistics. [not started yet]

Short architecture description:

  • State machine inside Django's MVC and Aiohttp. Both got API.

  • Pyrogram inside aiohttp with accounts connectors and easy api.

  • Pyrogram listen all account updates and send it to Django.

  • Custom Django middlewares catch request data from aiohttp, and send it to handle tasks.

  • Tasks make business logic and send result to Aiohttp > Account connector > Pyrogram > Telegram API.

  • Most of code inside Aiohttp is asynchronous.

Docker containers:

  • Django
  • Aiohttp
  • Celery
  • Redis
  • Memcached
  • Nginx

Containers connected with bridge inside docker

Setup:

This build is for demonstration or for UNSAFE local using only!

For production using, you need change database!

Before start use Telegram CMS, > Entry with telegram API:

  • sh ./create_session.sh
  • go for instructions inside bash script [will be fixed for creating session inside django admin panel]
  • added same config inside django admin panel at Configs application [will be fixed for full automatization]

Getting started with Telegram CMS

  • create session with same options as create_session.sh file

img

  • create some dialog scene

img

  • create triggers chain
  • Warn! Use entrypoint value at started trigger dialog and exitpoint value at exit trigger dialog

img

  • Customize your triggers chain!

img img

  • Next trigger

img img

  • And last trigger (except one). Exitpoint instance!

img img

v.0.2. alpha Features and notes:

  • added default Trigger middleware [auto answered middlewares with usable triggers system inside django admin panel]

v.0.3 alpha Features and notes

  • updates for default Trigger middlewares [more awesome features]
  • added Scenes (Scene of dialog) - now admin of django need to create Scene of dialog with user inside django admin panel. Just like need it at CMS!
  • starts added state machine for Scenes
  • added mode states for triggers [is_reverse_trigger, is_action, and other]
  • fixed Telegram API connectors on Aiohttp. Its fully work as multi-account system
  • added telegram plugin to django-admin-panel for session usage
  • and more other awesome things!

Listener Middleware Usage:

Check for your app is fully connected to telegram api. Create post.view with django rest framework, and go this way:

  • from apps.telegram.middlewares import ListenerMiddleware

  • listener = ListenerMiddleware()

  • @api_view(['POST'])

  • @listener.message

  • def create_message(request):

  • ...

Now, all of incoming messages will be handle with ListenerMiddlware, wich got default functions for all kinds of messages. You should create Base scene in django admin panel and add some triggers with triggered words and answers, for Trigger Middleware handle private messages. Add groups listeners for Listener Middleware handle non private messages.

Expectation in v.0.4. alpha:

  • Finish state mahine for scenes and triggers. +
  • Adding new default triggers! +
  • Customize CMS API for handle AI recognition patterns ?

Developing by me for people with love <3

About

Telegram-CMS (Content Management System) based on Django Framework and Aiohttp.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published