GithubHelp home page GithubHelp logo

navidshad / telegram-cms Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 4.0 190 KB

it is a nodejs application to lunch a telegram bot in seconds with primary components.

License: GNU General Public License v3.0

JavaScript 100.00%

telegram-cms's Introduction

Telegram-CMS

It is a nodejs application to launch a Telegram bot in seconds with primary components. I have been working on Telegram bots for almost 2 years and catched up most of needs for a chatbot. so I made this to solve lots of challenges and launching a bot easily. There is an ability to write your own modules on telegram-cms that I'll explain then. I'll complete this documentation during my tasks. but here is a simple "how to use"

Note

Sample Bots

How to use

  • Install it,
  • Create an app.js (or what ever you want)
  • Require it and start
    // this is your app.js file
    var tcms = require('telegram-cms');

    var option = {
        // mongo db path
        dbpath      :'mongodb://127.0.0.1:27017/telegram_cms',
        // bot token
        token       :'tokenxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
        // bot username
        botusername :'username_bot',
        // activate modules
        modules:{
            'category'          :true,	// category module
            'post'              :true,	// post module
            'settings'          :true,	// setting module
            'search'            :true,	// search module
            'sendbox'           :true,	// contact form module
            'inbox'             :true,	// a module for send message to users
            'chanelChecker'     :true,	// a module for connecting to a channel
            'favorites'         :true,	// a module to make favorite (favorite posts, etc)
        },

        // web
        serverport:2002,	//express server, needed for commerce module

        // folders
        modulespath: require('path').join(__dirname, 'plugins'),	// If you write your own modules
    }
    
    // initialize the cms
    tcms.start(option);

comment events

    // if nothing to be routed by moduls,
    global.fn.eventEmitter.on('nothingtoroute', (message, speratedSection, user) => {});

    // if user send a command type message
    global.fn.eventEmitter.on('commands', (message) => {});

    // receive from inline mode
    global.fn.eventEmitter.on('inlineQuery', (InlineQuery) => {});

    // schedule an event
    global.fn.eventEmitter.emit('addtoschedule', code, date,  parameters, callback);

telegram-cms's People

Contributors

abdifardin avatar kolahzary avatar navidshad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.