Skip to content

Repository files navigation

trace.moe-telegram-bot

License GitHub Workflow Status Docker Docker Image Size Discord

This Telegram Bot can tell the anime when you send an screenshot to it

https://telegram.me/WhatAnimeBot

WhatAnimeBot.mp4

Features

  • Show anime titles, episode, and timestamp from trace.moe
  • Image, GIF, Video, Stickers, URL support
  • Video preview
  • Supported Languages: English, Chinese, Japanese
  • Telegram group support
  • Guest Mode support

How to use

  1. Start chatting with the bot https://telegram.me/WhatAnimeBot
  2. Send anime screenshots (images, gif or video) directly to the bot
  3. You may also forward images from other chats to the bot
  4. The bot will tell you the anime, episode, and time code of it
  5. It will also send you a video preview of that scene

Search Options

When sending or replying with an image, you can include optional keywords in your message text or caption:

  • mute: Mutes the audio of the generated preview video.
  • nocrop: Disables automatic border cropping before searching.
  • skip: Skips generating the preview video and returns only the text search result.

Example: @WhatAnimeBot mute nocrop or captioning an image with skip.

How to use (in group)

  1. In a group, reply to an anime screenshot and mention the bot with @WhatAnimeBot
  2. The bot will reply with the anime information
  3. (Optional) If you want auto-complete when typing @WhatAnimeBot, you can add the bot to your group

Note: The bot will have access to your group messages when it is added to your group.

How to host the bot on your own

If you have privacy concern, you can host the bot on your own.

Please read Telegram's official tutorial to create a Bot first.

You need to disable Privacy Mode if you want to use your bot in group chat.

Environment Variables

TELEGRAM_TOKEN=       # e.g. 111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
TELEGRAM_WEBHOOK=     # e.g. https://your.host.com/
PORT=                 # (optional) Default: 3000
ADDR=                 # (optional) Default: 0.0.0.0
TRACE_MOE_KEY=        # (optional)
FILTER_ADULT=         # (optional) Default: true

Host with docker

Docker Image available on Docker Hub or GitHub Container Registry

docker run -it --rm --name trace-moe-tg-bot \
  -e TELEGRAM_WEBHOOK=https://your.host.com/ \
  -e TELEGRAM_TOKEN=111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA \
  -p 443:3000 \
  ghcr.io/soruly/trace.moe-telegram-bot:latest

Note that you need to configure a reverse proxy if you need HTTPS.

Host bare-metal with Node.js

Install Node.js >= 22.18, then:

git clone https://github.com/soruly/trace.moe-telegram-bot.git
cd trace.moe-telegram-bot
npm install
  • Copy .env.example to .env
  • Edit .env as you need
node server.ts

Run as systemd

Put this file to /etc/systemd/system/trace.moe-telegram-bot.service

[Unit]
Description=trace.moe-telegram-bot
Wants=network-online.target
After=network-online.target

[Service]
User=____
Group=____
WorkingDirectory=/home/____/project/trace.moe-telegram-bot
Environment=NODE_ENV=production
ExecStart=/usr/bin/node --dns-result-order=ipv6first /home/____/project/trace.moe-telegram-bot/server.ts
Restart=always

[Install]
WantedBy=multi-user.target

About

This Telegram Bot can tell the anime when you send an screenshot to it

Topics

Resources

Code of conduct

Security policy

Stars

559 stars

Watchers

25 watching

Forks

Sponsor this project

Packages

Used by

Contributors

Languages