2024/6/11:Gemini 1.5 Pro and Gemini 1.5 Flash can use system instructions.
2024/4/28:Support Bard.
-
/api_key setting-gemini [choice] [api_key]
- Can upload own google api key or delete it. (api key get from https://makersuite.google.com/app/apikey)
- [choice]:
delete
orset
personal api key.
- [choice]:
- Can upload own google api key or delete it. (api key get from https://makersuite.google.com/app/apikey)
-
/gemini conversation [model] [type] [use_prompt] [use_character]
- Create a thread exclusively for the user to chat with the bot.
- [model]:Choose AI model.
- [type]:Choose thread type, private or public.
- [system_instructions]:Only Gemini 1.5 Pro and Gemini 1.5 Flash can use it.
- [temperature]:Controls the level of randomness in the output, ranging from highly varied (closer to 1.0) to less surprising (closer to 0.0).
- [harrassment], [hate_speech], [sexually_explicit], [dangerous_content]:It's Safety Settings, the default is
Block some
.
- Create a thread exclusively for the user to chat with the bot.
-
/cookies setting-bard [choice] [secure_1psid] [secure_1psidts]
- Can upload own Bard Cookies or delete it.
- [choice]:
delete
orset
personal Bard Cookies. - [secure_1psid], [secure_1psidts]:Required Cookie Parameters.
- [choice]:
- Can upload own Bard Cookies or delete it.
-
/Bard conversation [type]
- Create a Bard thread exclusively for the user to chat with the bot.
- [type]:Choose thread type, private or public.
- Create a Bard thread exclusively for the user to chat with the bot.
pip install -r requirements.txt
Warning
It may not be stable.
Important
Since too many people using the same cookies may cause errors, it is recommended to ask the person who wants to use it to upload his/her own cookies.
- Go to https://gemini.google.com and login with your Google account
- Press F12 for web inspector, go to
Network
tab and refresh the page - Click any request and copy cookie values of
__Secure-1PSID
and__Secure-1PSIDTS
Rename the file.env.dev
to.env
, then open it and edit it.
DISCORD_BOT_TOKEN=
# Can get from https://makersuite.google.com/app/apikey
GEMINI_API_KEY=
# Setting default Bard cookies
BARD_SECURE_1PSID=
BARD_SECURE_1PSIDTS=
# Allow each commands only use in some channel, if you don't set it, just default to all channels.
# specific channel(s) for `/api_key setting-gemini`
GEMINI_SETTING_CHANNEL_ID=1227670969702754857,1227327094070254857
# specific channel(s) for `/gemini conversation`
GEMINI_CHAT_CHANNEL_ID=1227327094070254857
# specific channel(s) for `/bard conversation`
BARD_CHAT_CHANNEL_ID=
# specific channel(s) for `/cookies setting-bard`
BARD_COOKIES_SETTING_CHANNEL_ID=
# specific channel(s) for `/help`
HELP_CMD_CHANNEL_ID=
python3 bot.py
- generative-ai-python - https://github.com/google/generative-ai-python
- Gemini-API - https://github.com/HanaokaYuzu/Gemini-API
This project exists thanks to all the people who contribute.