GithubHelp home page GithubHelp logo

mahdiyarghd / toigbot Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 1.0 286 KB

๐ŸŒ€ Telegram bot which learns how to speak ๐ŸŒ€

License: MIT License

PHP 98.74% Dockerfile 1.26%
composer markov-chain php telebot telegram-api-bot telegram-bot

toigbot's Introduction

...

๐Ÿธ Toig Bot

Toig is a Telegram bot which uses Markov chain to learn how to speak from users messages. It can answer with text messages, but also stickers, animations.

To work correctly, Toig needs to store these information for each chat:

  • Chat ID
  • Sent words
  • Sent stickers
  • Sent gifs

Toig doesn`t store any information about users, such as user ID, username, profile picture and data are automatically deleted after 90 days of inactivity.


These are the available commands:
  • toig - Let me generate a message
  • sticker - Send a sticker
  • gif - Send a gif
  • torrent - Automatic replies
  • enablelearning - Enable learning
  • disablelearning - Disable learning
  • strike - Halve the memory of this chat
  • tsetting - Privacy stuff and special commands

And there are a number of extra commands that can be issued through /tsetting, namely:

  • /tsetting delete: Erase the entire content of the current chat in one shot. Be careful when using this function: the deletion of your data will happen without asking confirmation and is not reversible, so do it wisely.
  • /tsetting flag: Remove a specific sticker or gif from Toig' memory. Let's say some troll publishes a porn gif in your group. Instead of deleting it, reply to it with /tsetting flag, this way the gif will be removed from the bot's memory and Toig won't publish it again later. The operation can be undone with /tsetting unflag
  • /tsetting filter: With this command, you can specify the type of messages I send.

Since this bot has access to private messages of Telegram group users, it has been designed with a high focus on openness and transparency to guarantee that private data are not used in an improper way. The simple act of making the source code public is already a great step towards this goal, a step which has not been made by other bots similar to Toig. (except Fioriktos ๐Ÿ˜)

๐Ÿ”‘ Installation

Well, you can clone this project and make your custom version of Toig by changing following values in /resources/config.php:

// bot information, create your new bot through @BotFather. You can freely choose its name and profile picture, while as a list of commands, copy-paste the one at the top of this page
define('BOT_TOKEN', 'Bot Token'); 
define('BOT_ID', 'Bot ID');

// array of allowed chat ids, leave it empty if you want it to work for all chats
define('CHAT_ID', []);

// bot owner chat id, you can get it from @userinfobot
define('OWNER_ID', 1234567);

// DEBUG_MODE, if this is true, bot will send error logs to OWNER_ID with some deteils
define('DEBUG_MODE', true);

Also you can change $SUPPORT_ME variable in src/bot.php if you want bot to send a support link (...) randomly.

โ‰๏ธ What is assuring me that you won't read my private messages?

Toig is not storing the whole messages, but only the words composing them, so it is not technically possible to recover the original messages. Anyway, I would like to remark that, whenever you use a Telegram bot which has access to all messages you send, you are accepting the risk that the bot owner will use your data unfairly. If you use a bot which is closed source and you do not know where it is deployed, how it works, what data it stores and even who are the people managing it, nothing can guarantee that the unknown developers are not storing all your conversations in some hidden server.

โœ… Todo

  • Push first version of Toig
  • Update readme
  • Add new commands that can be used by users to have better control of Toig

๐Ÿค Contribute

This project is released and maintained under the GNU General Public License v3.0. Anyone can contribute to modify, improve, or add new features to this project. There are no obstacles to creating different forks of the project and developing it in a separate branch, whether free or commercial.

toigbot's People

Contributors

amirmohammadnemati avatar mahdiyarghd avatar

Stargazers

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