Discord OCR Bot
Description
The Discord OCR (Optical Character Recognition) Bot is a powerful tool that utilizes the Tesseract OCR engine to read text from images sent in Discord channels. Upon receiving an image, the bot processes it, extracts any text present, and then sends the extracted text in an embed message. It has the capacity to selectively operate in specified channels and can acknowledge messages with specific reactions.
Features
- Automatic OCR: Instantly converts images sent in specified channels into text.
- Real-time feedback: Reacts to images with a 🔍 emoji to indicate that OCR is in progress.
- Supports only image files: Ensures non-image attachments are ignored.
- Displays text in a neatly formatted embed.
Table of Contents
Installation
Prerequisites
Setup
-
Clone the repository
git clone https://github.com/Ashesh3/discord-ocr cd discord-ocr
-
Install dependencies
npm install
-
Configuration
Line 24 - Add a mapping for the channels you want the bot to operate in.
channels = { 'source_channel_id (This is where the images will be sent)': 'destination_channel_id (This is where the extracted text will be sent)' }
Line 79 - Add your Discord Bot Token
-
Start the bot
node index.js
Usage
- Send an Image: Upload an image containing text to a monitored Discord channel.
- Get Text: The bot will process the image and send an embed containing the extracted text.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgements
- Tesseract.js: Pure JavaScript OCR for 100 Languages 📖🎉🖥