A discord.js bot with Google's Bard integration
This project is made possible by PawanOsman's GoogleBard library
- Supports reply by
Message Content
orInteraction Reply
- Uses
discord.js@v13
(not LTS) - Supports continuous conversation (DM only)
- Easy to setup (need an access to Bard)
Grab cookie
- Visit bard.google.com
- Press F12 (open developer console)
- Go to Application → Cookies →
__Secure-1PSID
. Copy the value of that cookie.
Setup the bot
- Edit
config.js
, replaceCOOKIE
with the cookie you've just copied &TOKEN
with your Discord bot's token - Run the following commands to start the bot
$ npm install # install dependencies
$ npm run register # to register a slash command (you only have to run once)
$ npm start # start the bot
Ways to use
- Use
/ask prompt:<YOUR_QUESTION>
to ask a question (after registering the slash command) - DM the bot with your question (for continuous conversation)
Note For MessageCommand Support
- Enable the Message Content Intent in your Discord Bot Portal - place where you obtain your bot token
- Set the value of
messageCommand
in config.js totrue
You may now send
!ask <PROMPT>
in a server/guild, this is tantamount to the/ask
slash command
Feel free to create an issue for any help/concern. Contributions are always welcome, just create a pull request!
This project is available as an open source under the terms of the MIT License