Code Monkey home page Code Monkey logo

gemini-discord-bot's Introduction

Gemini Discord Bot

A Discord bot that uses Google's Generative AI, capable of engaging in conversations and processing images.

Features

  • Responds to mentions, direct messages, and when its name is used
  • Maintains conversation context for each channel
  • Processes and responds to images
  • Slash commands for managing context:
    • Set context size
    • View current context
    • Clear context

Setup

  1. Clone the repository

  2. Install dependencies:

    npm install
    
  3. Create a .env file with your Discord token and Google API key:

    DISCORD_TOKEN=your_discord_token_here
    GOOGLE_API_KEY=your_google_api_key_here
    
  4. Configure the bot in config.ts:

    • Set BOT_NAME to your desired bot name
    • Choose the MODEL_NAME for the Google Generative AI model
    • Adjust SAFETY_SETTINGS to your preferred thresholds (For more information, see Gemini API Safety Settings)
    • Modify ALLOWED_IMAGE_TYPES if needed
  5. Run the bot:

    npm start
    

Usage

  • Mention the bot or use its name to start a conversation
  • Send images for the bot to analyze and respond to
  • Use slash commands to manage conversation context:
    • /view-context: Display the current context
    • /set-context: Set the number of messages to keep in context
    • /clear-context: Clear the current context

Dependencies

  • discord.js
  • @google/generative-ai
  • dotenv
  • undici

gemini-discord-bot's People

Contributors

detalhe avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.