Skip to main content

Create a Witty Telegram Bot with AI-Powered Humor, Roasts & Stats using OpenRouter

Workflow preview

Workflow preview
100%
Create a Witty Telegram Bot with AI-Powered Humor, Roasts & Stats using OpenRouter preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

GiggleGPTBot — Witty Telegram Bot with AI & Postgres Overview GiggleGPTBot is a witty Telegram bot built with n8n , OpenRouter , and Postgres . It delivers short jokes, motivational one liners, ...

Best for

  • AI Chatbot automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, @n8n/n8n-nodes-langchain.lmchatopenrouter, n8n-nodes-base.postgres, n8n-nodes-base.scheduletrigger, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.if, n8n-nodes-base.telegram

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Sergey Skorobogatov.

Original n8n.io source

1.1 Workflow description

Title
Create a Witty Telegram Bot with AI-Powered Humor, Roasts & Stats using OpenRouter
Workflow name
Create a Witty Telegram Bot with AI-Powered Humor, Roasts & Stats using OpenRouter

GiggleGPTBot — Witty Telegram Bot with AI & Postgres

📝 Overview

GiggleGPTBot is a witty Telegram bot built with n8n, OpenRouter, and Postgres. It delivers short jokes, motivational one-liners, and playful roasts, responds to mentions, and posts scheduled witty content. The workflow also tracks user activity and provides lightweight statistics and leaderboards.


✨ Features

  • 🤖 AI-powered humor engine — replies with jokes, motivation, random witty lines, or sarcastic roasts.
  • 💬 Command support/joke, /inspire, /random, /roast, /help, /stats, /top.
  • 🎯 Mention detection — replies when users tag @GiggleGPTBot.
  • Scheduled posts — morning jokes, daily motivation, and random wisdom at configured times.
  • 📊 User analytics — counts messages, commands, reactions, and generates leaderboards.
  • 🗄️ Postgres persistence — robust schema with tables for messages, responses, stats, and schedules.

🛠️ How It Works

  1. Triggers

    • Telegram Trigger — receives all messages and commands from a chat.
    • Schedule Trigger — runs hourly to check for planned posts.
  2. Processing

    • Switch routes commands (/joke, /inspire, /random, /roast, /help, /stats, /top).
    • Chat history fetches the latest context.
    • Mention Analysis determines if the bot was mentioned.
    • Generating an information response builds replies for /help, /stats, /top.
    • AI nodes (AI response to command, AI response to mention, AI post generation) craft witty content via OpenRouter.
  3. Persistence

    • Init Database ensures tables exist (user_messages, bot_responses, bot_commands, message_reactions, scheduled_posts, user_stats).
    • Logging nodes update stats and store every bot/user interaction.
  4. Delivery

    • Replies are sent back via Telegram Send nodes (Send AI response, Send info reply, Reply to Mention, Submit scheduled post).

⚙️ Setup Instructions

  1. Create a Telegram Bot with @BotFather and get your API token.

  2. Add credentials in n8n:

    • Telegram API (your bot token)
    • OpenRouter (API key from openrouter.ai)
    • Postgres (use your DB, Supabase works well).
  3. Run the Init Database node once to create all required tables.

  4. (Optional) Seed schedule with the Adding a schedule node — it inserts:

    • Morning joke at 06:00
    • Daily motivation at 09:00
    • Random wisdom at 17:00 (Adjust chat_id to your group/channel ID.)
  5. Activate workflow and connect Telegram Webhook or Polling.


📊 Database Schema

  • user_messages — stores user chat messages.
  • bot_responses — saves bot replies.
  • bot_commands — logs command usage.
  • message_reactions — tracks reactions.
  • scheduled_posts — holds scheduled jokes/wisdom/motivation.
  • user_stats — aggregates per-user message/command counts and activity.

🔑 Example Commands

  • /joke → witty one-liner with light irony.
  • /inspire → short motivational phrase.
  • /random → unexpected witty remark.
  • /roast → sarcastic roast (no offensive targeting).
  • /stats → shows your personal stats.
  • /top → displays leaderboard.
  • /help → lists available commands.
  • @GiggleGPTBot + message → bot replies in context.

🚀 Customization Ideas

  • Add new command categories (/quote, /fact, /news).
  • Expand analytics with reaction counts or streaks.
  • Localize prompts into multiple languages.
  • Adjust CRON schedules for posts.

✅ Requirements

  • Telegram Bot token
  • OpenRouter API key
  • Postgres database

📦 Import this workflow, configure credentials, run the DB initializer — and your witty AI-powered Telegram companion is ready!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook Telegram

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1

Block 2 - OpenRouter Commands

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 3 - Init Database

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Block 4 - Log message + statistics

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Block 5 - Adding a schedule

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Block 6 - Schedule

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1

Block 7 - Get scheduled posts

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Block 8 - Chat history

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Block 9 - Mention Analysis

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Get user statistics

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Block 11 - Get top users

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Block 12 - AI response to command

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 13 - Generating an information response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - Response type

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 15 - Send info reply

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1

Block 16 - Send AI response

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1

Block 17 - AI response to mention

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 18 - Reply to Mention

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1

Block 19 - AI post generation

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 20 - Submit scheduled post

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1

Block 21 - Save Bot Response

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Block 22 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 23 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 24 - Log command

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2

Showing the first 24 of 27 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Create a Witty Telegram Bot with AI-Powered Humor, Roasts & Stats using OpenRouter
Complexity advanced
Nodes 27
Categories AI Chatbot, Multimodal AI
Author Sergey Skorobogatov
Published 20 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7655/7655.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create a Witty Telegram Bot with AI-Powered Humor, Roasts & Stats using OpenRouter do?

GiggleGPTBot — Witty Telegram Bot with AI & Postgres Overview GiggleGPTBot is a witty Telegram bot built with n8n , OpenRouter , and Postgres . It delivers short jokes, motivational one liners, ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your AI Chatbot, Multimodal AI use case.