This project is a Discord bot that integrates with the Gemini API. It allows authorized users to interact with the Gemini API through specific channels in Discord. you can get a bot like below:
1.Have a discord account and visit discord api platform 2.New application, specify its basic information. 3.switch to bot and enable PUBLIC BOT and MESSAGE CONTENT INTENT. 4.direct to Oauth2-URL generator, enable bot and applications.commands in scopes, then chose adminstrator in BOT PERMISSIONS to generate invite link, copy the link below, and open in a new tab, you can invite the bot in your own discord server.
Clone the repository to your local machine.
Navigate to the project directory.
Install the dependencies by running npm install
.
Copy the .env.example
file to a new file named .env
.
Replace your_token
and your_api_key
in the .env
file with your Discord token and Gemini API key, respectively.
you can get your gemini key here
you can get your discord bot token here
Replace the user and channel IDs in AUTHORIZED_USERS
and AUTHORIZED_CHANNELS
with the IDs of the users and channels that you want to authorize.
Start the bot by running npm start
. The bot will then be active in the authorized channels.
If you want to deploy the bot using Docker, you can build a Docker image and run a container using the provided Dockerfile.
docker build -t discord_bot .
.docker run -d discord_bot
.Please note that the bot needs to be able to access the Discord and Gemini APIs, so make sure your deployment environment allows outbound network connections.
Contributions are welcome. Please submit a pull request if you have something to add or fix.
This project is licensed under the ISC license.