Discord.js bot that can be set to transcribe message attachments from specific discord channels using tesseract.js.
- To transcribe a single message select
Apps > OCR
from message's context menu. - To enable automatic transcription in a channel make sure the bot can view channel, send messages and read message history (that one is required to be able to link the original message when responing).
Then bot owner or someone with manage channel permission can use/toggle-ocr
to toggle automatic transcribing. - You can use
/ocr-status
to check if automatic ocr is enabled in current channel
-
Make sure you have nodejs version
^16.6.1
installed. -
Create discord bot in developer panel and copy its token.
-
Download this repository and install dependencies with
npm i
-
Launch bot with
node bot.js
to generatedata/token.json
- paste your bot token there. -
Use
npm run get-invite
to generate invite link and use it to add the bot to your server. -
Use
npm run register
to register slash commands - it can take up to an hour before discord finishes processing them. -
Start bot with
node bot.js
- or alternatively if you have pm2 installed:
npm run start