riNN.dev

Meme bot

bot

Meme bot

bot

An asynchronous Telegram bot that finds memes by topic, fetches jokes and translates them on the fly.

Info

  • Python, aiogram 3, aiohttp, SQLAlchemy + SQLite, FastAPI, Vercel

    Built with

  • Solo, a mini project on working with APIs

    Role

What it does

  • Topic search

    Finds keywords in a message (cats, python, exams…) through a keyword table in SQLite and sends a matching meme found with the Pinterest API.

  • Jokes with translation

    Fetches a random joke from JokeAPI and translates it from English to Russian with the MyMemory API.

  • One-tap language switch

    An inline button flips the same joke between languages. Both versions are cached, so there is no second request.

  • Retries without waiting

    If an API is down or a picture won’t load, the bot offers a retry button instead of making you type again.

  • Serverless

    Runs on Vercel: a FastAPI endpoint receives Telegram webhooks and passes them to aiogram.

How it’s built

main.py                 entry point
bot.py                  Bot, Dispatcher, routers
api/index.py            FastAPI webhook for Vercel
handlers/               commands, messages, inline buttons
services/api.py         memes, jokes, translation
services/keyboards.py   inline keyboards
databases/              SQLAlchemy models: categories, keywords
utils/helpers.py        find_topic, send_joke, send_meme

Meme bot

bot

  1. Today

A working copy of the bot in your browser. Type a topic (“cats”, “python”, “exam”, “anime”) or tap a key. Jokes and translations come live from JokeAPI and MyMemory; memes are drawn here instead of fetched from Pinterest.