Giter Site home page Giter Site logo

nodegram-bot's Introduction

# nodegram-bot A Telegram-bot written in Node.JS

The trend plugin

First things first

To make your bot working you have to gather somehow a valid SSL certificate, because as stated in the docs of Telegram

Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update.

This is the most tricky part. Once you've set-up your domain with the SSL certificate (maybe gathered from StartSSL from Let's Encrypt) you could proceed to the configuration of apache.

Virtual Hosts, oh, virtual hosts

In my setup I used two Apache2 servers, I know, don't blame me, it was due to a management choice. In this section we'll keep it simple and illustrate how to configure the Proxy Server (apache2)

<VirtualHost *:443>
#SSL setup
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCertificateFile "/etc/apache2/ssl/denvit.work.crt"
SSLCertificateKeyFile "/etc/apache2/ssl/denvit.work.pem"
SSLCertificateChainFile "/etc/apache2/ssl/startssl.pem"
SSLCertificateChainFile "/etc/apache2/ssl/sub.class1.server.ca.startssl.pem"

#Host info
ServerName denvit.work
ServerAlias vps.denvit.work

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:30303/
ProxyPassReverse / http://127.0.0.1:30303/
</VirtualHost>

Things you probably need to change:

  • SSLCertificateFile, this is the path of your SSL certificate file
  • SSLCertificateKeyFile, this is the key of your SSL pair
  • ServerName, this is your hostname. The one specified into the settings.js file
  • ServerAlias, this is an alias for your virtualhost (in my case it's also reachable via https://vps.denvit.work/)

Set up everything as this and just change it as you need. The port should be 30303 if you didn't changed it into settings.js

Plugins

Plugin manager

The plugin manager

This is the father of every plugin, its job is to enable and disable the plugins on the fly when a superuser wants to. The list of enabled plugins is kept, so you don't have to manually reenable everything at startup (check data/plugins_enabled.json for more info)

Usage

/plugin list

List every plugin available (and their status)

/plugin enable <plugin name>

Enables a plugin

/plugins disable <plugin name>

Disable a plugin

/getmyid

Shows your ID, this is very useful if you want to add yourself to the superusers and you look for your id

Help

The help plugin

This plugin takes care of supplying all the usage information about the plugins to the user when requested

Usage

/help

Shows the general help, based on the enabled plugins

/help <plugin friendly name>

Shows the plugin informations (Name, Friendly Name, Description and Usage)

Genmeme

Creates a meme based on a your google images search keywords and the text(s) you provide Genmeme plugin

Usage

/genmeme image keywords-top text-bottom text

Trends

Show a graph of trend based on Google Trends Trends plugin

Usage

/trend trend1,trend2[,trend3,...]

Clear

Did you ever thought of cleaning your chat? Now you can, with Mr.Clean!

Result

(obviously the output is more longer) Clear

Usage

/clear

Version

Shows the version of the nodegram-bot

Result

Version

Usage

/version

nodegram-bot's People

Contributors

denysvitali avatar zsavajji avatar

Watchers

James Cloos avatar Jack Zero 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.