Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jtemize

Jtemize is a TypeScript Discord bot that uses Mastra and an OpenAI model to chat with users and extract invoice data into structured JSON from text, images, and PDFs.

What It Does

  • Chat with users through Discord using !chat
  • Extract invoice JSON from pasted text using !invoice
  • Extract invoice JSON from attached images and PDFs using !invoice
  • Validate extracted invoice output with Zod

Stack

  • TypeScript
  • Discord.js
  • Mastra
  • OpenAI
  • Zod

Project Structure

Setup

  1. Install dependencies:
npm install
  1. Create a .env file in the project root:
OPENAI_API_KEY=your_openai_api_key
DISCORD_BOT_TOKEN=your_discord_bot_token
DISCORD_CLIENT_ID=your_discord_application_id
DISCORD_GUILD_ID=optional_test_server_id
OPENAI_MODEL=gpt-4.1-mini
  1. In the Discord Developer Portal:
  • Create or open your application
  • Add a bot under the Bot section
  • Copy the bot token into DISCORD_BOT_TOKEN
  • Use the Application ID as DISCORD_CLIENT_ID
  • Enable Message Content Intent
  • Invite the bot to your Discord server

How To Run

Start the bot in development mode:

npm run dev

If startup succeeds, you should see a log like:

Discord bot ready as ...

You can also run a type check:

npm run typecheck

Discord Usage

  • !chat What can you do?
  • !invoice plus pasted invoice text
  • !invoice plus an attached invoice image
  • !invoice plus an attached invoice PDF

Notes

  • This project is designed as a learning project for TypeScript and agent-based application structure.
  • The current bot uses Discord message commands, not slash commands.
  • The local .env file should not be committed to Git.

About

LLM Based invoice/recepit extraction

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages