sppidy / DankBot

DankBot - A Telegram Bot that sends, generates, and *deep fries* memes.

Home Page:https://telegram.me/TheRealDankBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DankBot

Heroku License: GPL v3 Codacy Badge CodeFactor Codebeat Badge Maintainability PRs Welcome Say Thanks!

DankBot is a simple Telegram Bot which sends, generates, and deep fries memes.

Why DankBot?

DankBot has been an extremely fun project to work on.

The idea itself started off as a joke - My friends and I would often reference memes in our conversations and wishfully discuss about a tool that would share memes in response to certain triggers. While the idea of making a bot had occurred to me, the fact that Whatsapp, our primary communications app, didn't have a public API was discouraging. After a lot of deliberation, I began this project on the fourth of September, 2018.

Major Technologies Used

  • Python 3.7
  • PIL (Pillow)
  • OpenCV
  • Numba
  • Python Telegram Bot
  • Papertrail

Things I've Learnt

  • Building stateless, event-driven bots
  • Manipulating images with PIL
  • Uploading images to Imgur with PyImgur
  • Detecting characters and eyes in images using OpenCV
  • Extracting frames from a video and making videos from a series of frames using OpenCV + imutils.
  • Using Numba JIT and asynchronous execution to improve performance
  • Applying binary search on discrete functions (Used to calculating optimum text size in the meme generator)
  • Using papertrail for centralized logging
  • Static log analysis (DankBot Stats)

Using DankBot

Basic Commands

Each of these commands trigger a certain response.
For most commands, there are multiple responses from which one is randomly picked.

  • Hmmm
  • Boom son
  • Just do it
  • E
  • Hello there
  • I don't think so
  • Wut / Wat / Dude what / What even / What the
  • Ironic
  • F / RIP
  • ???

Advanced Commands

ABC, not XYZ

Generates a meme using either the Robbie Rotten, Babushka, or Drake template in which ABC is chosen over XYZ.

Alt: ABC

Converts text that follows the colon to aLt CaSe. It deletes the trigger message if bot has admin rights.

Vaporize: ABC

Converts text that follows the colon to Vaporwave text. It deletes the trigger message if bot has admin rights.

🅱

Replaces the first consonant group of each word with a 🅱.
It doesn't replace those consonants which can (mostly) be pronounced after a B.

Alexa / Dankbot play Despacito [x]

Sends a GIF of the Despacito music video along with an audio file of Despacito.
If a number x is given, certain effects are applied to the audio.
If not, the audio file has a 10% chance of being extremely bass boosted.

T: ABC B: XYZ

Creates a meme with the provided captions: ABC as the top-text and XYZ as the bottom-text. By default, the captions are converted to upper case. Replacing T with Ts and B with Bs prevents auto-capitalization.

Deep Fryer

The Deep Fryer fries images, GIFs, or videos (Experimental). Frying includes increasing saturation & contrast, and adding noise, emojis, laser eyes, and bulges.

The action is triggered by replying to a message containing a media file with one of the following commands:

  • Fry: 1 cycle of frying.
  • Nuke: 3 cycles of frying.
  • Tsar Bomba: 5 cycles of frying.

Additional parameters

Deep: High contrast and saturation increase.
Shallow: Low contrast and saturation increase.

High-fat: Emojis are increased.
Low-fat: Emojis are reduced.
No-fat: Emojis aren't added.

Heavy: Extra bulges are added.
Light: No bulges are added.

Vitamin-B: (Experimental) Adds the B emoji on text in the image.
Chilli: (Experimental) Adds laser eyes.

About

DankBot - A Telegram Bot that sends, generates, and *deep fries* memes.

https://telegram.me/TheRealDankBot

License:GNU General Public License v3.0


Languages

Language:Python 100.0%