Code Monkey home page Code Monkey logo

tg_notification_center's Introduction

Telegram Notification Center


What is this?

This is a bot that runs on your personal account, that notifies you on a chat you define about mentions and replies. It also forwards the message so you won't miss it.

Never miss a reply or a direct mention anymore.


# Tested on Debian 7, for other OSes check out https://github.com/yagop/telegram-bot/wiki/Installation
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev make unzip git redis-server g++ libjansson-dev libpython-dev expat libexpat1-dev
# After installing the dependencies, install the bot
cd $HOME
git clone https://github.com/FerdinandoLM/TG_Notification_Center.git
cd TG_Notification_Center
./launch.sh install
./launch.sh # Will ask you for a phone number & confirmation code or just your bot token.

There are two more scripts to launch the bot: launchd.sh will run tg-cli over gdb, launchf.sh will take care of restarting the bot in case it crashes, deleting tg-cli's state file to prevent reparsing buggy/broken messages.

To enable the API bot mode, before doing ./launch.sh install, run touch bot_mode.

Take in account that logging in with a bot token has some caveats: delmsg and mute do not work (API bots cannot delete messages), by reply commands such as #promote might misbehave, !join will not work (API bots can only be invited, they cannot join a group by themselves).


Setting up the Notification Center:

To run this plugin you must install a bot and login with the telegram account that you want to monitor. You may run as a normal bot, but you won't be able to check replies torwards your account. You will instead be notified if someone replies to your bot. Also, running it as a bot needs that you add that bot inside every group you want to be notified of.

  1. Create a bot using BotFather on telegram: t.me/BotFather

  2. Create a group with you and your new bot, to make it nicer, call it "Notification Center" Notice: (There is no need to put the bot inside other groups except the notification center)

  3. Get the group ID of the group, there are many bots doing that on telegram. Otherwise, one other way get it, is to use the id.lua plugin from original yagop bot

  4. Edit the /plugins/notificationcenter.lua file as follows:

    a. Put the group ID on the variable receiverid and receiverid2 , example: receiverid = 'chat#id1234567'

    b. Search for "alpha", "beta" and "delta" and change them with anything you want (keep the quotation marks). For example i use many versions of my name, my nickname and things like that in order to keep track when people try to call me without @nickname trigger. The reply checker simply checks if someone replies to your messages. Note that this only works if you're using the bot under your personal account, and won't work if operating under Telegram Bot APIs

    c. Copy the BOT API Key you got from BotFather and put it on the var bottoken example: bottoken = "123456789:ABCD1234jklmnOPQ56789xyz"

  5. Restart the bot and you're all set.

To disable one of the features change the value of local mcheck = "1" and local rcheck = "1" To "0". mcheck= "0" disables mentions checking, rcheck = "0" disables replies checking (it's simple: 1 = enabled; 0 = disabled)


Picture(s)

1 An example of a mention and a reply. As you can see there is a message sent from the bot and a forward of the message made from yourself


Credits

A Telegram Bot based on plugins using tg. Forked from LucentW's s-uzzbot, which is forked from uziins' uzzbot, which is forked from Yagop's.


Version

Version: 4.2.2 Version date: 2017-08-23 Version codename: TwinBot


tg_notification_center's People

Contributors

ferdinandolm avatar

Stargazers

Roman avatar Jianlucah avatar Himadri Ganguly avatar

Watchers

James Cloos avatar  avatar

tg_notification_center's Issues

Build json config file

At the current state you have to manually edit the plugin file.

Building a json config file where to insert chat id, bot token and all the trigger words would be perfect.

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.