Skip to content

paramkpr/DankBot

Repository files navigation

DankBot

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

DankBot is a Telegram Bot which can send, generate, and fry 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

Things I've Learnt

  • Building stateless, event-driven bots
  • Manipulating images with PIL
  • Uploading images to Imgur
  • Using OpenCV to find eyes and characters in an image
  • Extracting frames from a video and making videos from a series of frames using OpenCV + imutils.
  • Using Numba JIT and asynchronous processing for improving performance
  • Applying binary search on discrete functions (Used to calculating optimum text size in the meme generator)

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
  • Nein
  • E
  • Hello there
  • I don't think so
  • Wut / Wat / Dude what / What even / What the
  • Miss me with that gay shit
  • 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.

Vapourize: ABC

Converts text that follows the colon to Vapourwave 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, lazer 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.
  • Allah hu Akbar: 5 cycles of frying.
  • Tsar Bomba: 10 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

Official repository of DankBot on Telegram.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages