GithubHelp home page GithubHelp logo

mehedi-shafi / best-memes-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from i32ropie/best-memes-bot

0.0 1.0 0.0 61 KB

Source code of the Telegram bot @best_memes_bot

License: GNU General Public License v3.0

Python 100.00%

best-memes-bot's Introduction

best-memes-bot

Source code of the Telegram bot @best_memes_bot

Table of contents

The idea

The main idea of the bot is to have somewhere to get random and good memes. The bot started with some memes I already had (~700), and keeps track of which memes have been seen by the user so you never get a meme repeated.

It has a system that allows everybody to send their memes, and then it get aproved or rejected by me (Some mods in the future).

Since I love memes, I will post new memes kinda daily.

I would also like to implement a recommeder system so when a user requests a new meme, it will try to find a meme that the user will enjoy.

Development stage

Currently the bot is in an optimal stage. There is the ability to see memes, save them, see the saved one, report memes and upload new memes.

TODO

  • Add basic admin tools

Add the ability of ban users, send broadcast messages, restart the bot, execute python code, send messages, check for github updates.

  • Add basic tools

Let users contact me.

  • Add /memes command

This command will show a random meme, and an inline keyboard with three buttons: one to go to the previous seen meme, one to go to a new meme (next meme if the user used before the one to navigate to a previous meme), one to save the meme.

  • Add /saved command

This command will work as /memes but just navigating through the saved memes (So the user can see easily the memes he likes).

  • Add the 'upload meme' infrastructure

Gotta make something to let the users upload new memes.

  • Add creator to the memes and list of created memes to the users

As said before, I would like to let users upload memes, and if in the future I reward any of them, I will probably take that in count.

  • Add the reviewer to the memes

Would be nice to know who reviewed what.

  • Button to report a meme

A button in the memes navigation inline keyboard to allow users to report memes. When reported, the user has to explain why he reports the meme and I think the best idea is that I personally review it. This way I think I could identify if a mod isn't reviewing memes correctly.

  • Upload the bot strings to Transifex

Since the bot will be an open source, I would like to have the strings uploaded to Transifex, just in case someone wants to use the bot in their own language and want to help to translate it.

  • Add like and dislike buttons

Would be cool to let users vote the memes and add a command to see the most voted memes.

  • Add extra functionalities for admins and users

Let admins set mods and let users get their stats / info.

  • Add /fresh command

Add a command that will only show memes uploaded in the last 48 hours.

  • Let the users decide their language

Right now the bot automatically gets the user language from Telegram, but in the future would be nice to let users decide their language.

  • Add categories to the memes I already have

There are a lot of memes already but none of them has a category yet.

Lategame

In the late future, and only if the bot grows enough, I would really like to implement a recommender system.

Changelog

15-02-2019

[1]

First commit :)

[2]

Now, when I send a meme to the bot, it is added to the database. I have also updated the memes structure to save the uploader, the reviewer and how many saves it has (despite only I can send memes yet and nobody can save 'em xD)

I have also changed the message I get with new users but I don't really like it, I have to update it yet.

The last change was in the template, changing the word of the command to make it easier the change of it while developing a new plugin based on the template.

16-02-2019

[1]

Added admin tools for:

  • Ban and unban users.
  • Broadcast messages.
  • Reload the bot.
  • Execute code.
  • Check for github updates and reload the bot if there is any.
  • Send messages to certain IDs.
  • Reply to users contact messages.
  • Command to check admin commands.

Added user tools for:

  • Contact the admins.

17-02-2019

[1]

Tonight I have actually done a lot of work. I think the bot is actually prepared for a release. I have done:

  • Now the bot no longer has the command /meme but /memes, which lets you navigate through all the memes stored in the bot, save the memes you like and report the memes you find wrong.
  • Improved the /start message, adding an inline button that works as typing /memes, making it easier the first use.
  • Added a /help command where the user can see commands he can use.
  • Added a /info command to display a bit of info about the bot.
  • Added a good report system, making it easy how to report memes, and also making it easy how to answer to the reports.
  • Now users can send memes to the bot and I will be able to easily accept or decline the meme.
  • Added a /saved command where the user can navigate through his saved memes.

The only remaining things to do are not actually that important for the early stages of the bot, so tomorrow I will start spreading the word.

[2]
  • Fixed a small typo in the bot strings + added a bit more info in the /start command
  • Changed TODO's order to leave the undone work in the botton
[3]
  • Updated the callback_data for those that used the memes' file_id to shorter ones to prevent long file_ids creating invalid inline buttons.
  • Restricted memes with file_ids longer than 62. (I haven't seen one in more than 2k file_ids but better control the posibility)
[4]
  • Updated the /memes command to handle correctly the use of users that have already seen all the bot memes.
[5]
  • Updated the arrows of the inline keyboard to make them easier to see
  • Removed the meme file_id caption
  • Updated the structure of the README
[6]
  • Added a command to filter chats and make it easier the communication with the users
  • Added a try/catch block when editing messages, to find when the bot tries to edit a message with the same content as before

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.