Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
/ Discord-LaTeX Public archive

A bot to format LaTex text and do other math related things in discord

License

Notifications You must be signed in to change notification settings

danielkorkin/Discord-LaTeX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaTeX Equation Discord Bot

A Discord bot that generates LaTeX equations from text inputs and converts them into PNG images for easy sharing. Powered by Google Generative AI Gemini Model.

Prerequisites

Setting up the Bot

1. Create a Discord Bot

  1. Create a New Application:
  2. Create a Bot:
    • Under Bot, click Add Bot.
    • Save your token and add it to the .env file.

2. Setting Up Your Environment

  • Create a .env file with the following variables:
    TOKEN=your-discord-bot-token
    GUILD_ID=your-guild-id
    GOOGLE_API_KEY=your-google-api-key

3. Install Required Software

Mac

  1. Install MacTeX: Download and install MacTeX
  2. Install Python Requirements: Run the following command:
    pip install -r requirements.txt

Windows

  1. Install MiKTeX: Download and install MiKTeX
  2. Install Python Requirements: Run:
    pip install -r requirements.txt

Linux

  1. Install TeX Live:
    • Debian/Ubuntu: sudo apt install texlive
    • Fedora/Red Hat: sudo dnf install texlive
  2. Install Python Requirements:
    pip install -r requirements.txt

Raspberry Pi (Linux)

  1. Install TeX Live: Same as Linux instructions above.
  2. Install Python Requirements: Follow Linux instructions.

4. Get Google Gemini API Key

  • Sign up at Google Generative AI API
  • Create a project and an API key.
  • Enable the Generative Language API and add the key to your .env file.

5. Running the Bot

  • Start the bot by running the Python script:
    python bot.py

Docker Instructions

For details on docker instructions look at the docker.md file

Troubleshooting

  • Ensure your .env file has correct values.
  • Check if all software dependencies are correctly installed.

Contributing

Contributions are welcome! Please submit issues or pull requests to improve this bot.