Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A Telegram bot that can impersonate you by responding to messages using custom instructions

License

Notifications You must be signed in to change notification settings

derogab/fake-me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

51 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Fake Me

A Telegram bot that can impersonate you by responding to messages using custom instructions

Overview

This bot monitors your Telegram business messages and responds automatically by pretending to be you, making it appear as if you're actively participating in conversations.

Warning: this bot is designed to impersonate you on Telegram. Use responsibly and ensure compliance with Telegram's Terms of Service and applicable laws in your jurisdiction.

Features

  • ๐Ÿค– AI-powered responses: Uses LLM to generate human-like replies
  • ๐Ÿ“ Multiple instruction sets: Configure different behaviors for different chats
  • ๐Ÿ’ผ Business message support: Works with Telegram Business accounts
  • ๐Ÿ—„๏ธ Redis storage: Persistent conversation history and queue management
  • โฐ Configurable scheduling: Responds to messages every 7 minutes by default
  • ๐Ÿณ Docker support: Easy deployment with Docker Compose

Requirements

  • Node.js
  • Redis server
  • Telegram Bot Token (from @BotFather)
  • LLM service (OpenAI, Cloudflare AI, Ollama, Llama.cpp or OpenAI Compatible API)

Installation

Local Development

  1. Clone the repository:
git clone <repository-url>
cd fake-me
  1. Install dependencies:
npm install
  1. Create configuration file:
cp config.template.yml config.yml
  1. Create environment file:
cp .env.template .env
  1. Configure your environment variables in .env

  2. Configure your configuration in config.yml

  3. Compile TypeScript:

npm run compile
  1. Start the bot:
npm start

Docker Deployment

  1. Copy .env.template to .env and configure with own keys, etc.

  2. Copy config.template.yml to config.yml and configure with chats instructions.

  3. Start with Docker Compose:

docker-compose -f docker/docker-compose.yml up -d # --build to build from source

Configuration

Environment Variables

Variable Description Default
TELEGRAM_BOT_TOKEN Your Telegram bot token (required) -
TELEGRAM_OWN_ID Your Telegram user ID (to distinguish your messages) (required) -
OPENAI_API_KEY Your OpenAI API key (optional, for OpenAI integration) -
OLLAMA_URI URI for the Ollama server (optional) http://localhost:11434
OLLAMA_MODEL Model to use with Ollama (optional) llama3.1
CLOUDFLARE_ACCOUNT_ID Cloudflare account ID (optional, for Cloudflare AI) -
CLOUDFLARE_AUTH_KEY Cloudflare authorization key (optional, for Cloudflare AI) -
CLOUDFLARE_MODEL Cloudflare model name (optional, for Cloudflare AI) -
LLAMA_CPP_MODEL_PATH Path to GGUF model file (optional, for Llama.cpp integration) -
REDIS_URL URL for the Redis server (optional) redis://localhost:6379
TZ Timezone UTC

Chat Configuration (config.yml)

The bot uses instruction sets to define different behaviors for different chats:

version: 1

instruction_sets:
  default:
    name: Default behavior
    description: Pretend to be the user and reply without getting caught
    instructions:
      - You are an AI that can pretend to be a real person, but no one has to know about it.
      - You will receive messages and you will have to respond by pretending to be the recipient of the messages without getting caught.
      - Do not answer with a question unless it is really necessary in the speech.
      - You are not an assistant. You don't have to serve the user but just have conversation.
      - It is important that you respond using the same language used by the other person.
  
  emojis:
    name: Emojis behavior
    description: Reply always with only emojis
    instructions:
      - Reply always with only emojis

chats:
  - instruction_set: default
    ids:
      - 13579
      - 24680
  - instruction_set: emojis
    ids:
      - 123456789

How It Works

  1. Message Reception: The bot listens for business messages on Telegram
  2. Message Storage: Incoming messages are stored in Redis with conversation history
  3. Queue Management: Non-self messages are added to a processing queue
  4. Scheduled Processing: Every 7 minutes, the bot processes queued chats
  5. AI Response: Generates responses using configured instruction sets and chat history
  6. Message Sending: Sends AI-generated responses back to the original chat

Usage

  1. Set up a Telegram Business account
  2. Create a bot using @BotFather
  3. Configure LLM to use
  4. Configure the bot with your credentials
  5. Add chat IDs and instruction sets to your config.yml file
    • Finding chat IDs: forward a message of target chat to a bot like @my_id_bot
  6. Start the bot and let it handle your messages automatically

Credits

Fake Me is made with โ™ฅ by derogab and it's released under the MIT license.

Contributors

Tip

If you like this project or directly benefit from it, please consider buying me a coffee:
๐Ÿ”— bc1qd0qatgz8h62uvnr74utwncc6j5ckfz2v2g4lef
โšก๏ธ [email protected]
๐Ÿ’ถ Sponsor on GitHub

Stargazers over time

Stargazers over time

About

A Telegram bot that can impersonate you by responding to messages using custom instructions

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •