Skip to content

apter-tech/bard-discord-bot

 
 

Repository files navigation

A discord.js bot with Google's Bard integration

This project is made possible by PawanOsman's GoogleBard library

About

  • Supports reply by Message Content or Interaction Reply
  • Uses discord.js@v13 (not LTS)
  • Supports continuous conversation (DM only)
  • Easy to setup (need an access to Bard)

How to setup

Grab cookie

  1. Visit bard.google.com
  2. Press F12 (open developer console)
  3. Go to Application → Cookies → __Secure-1PSID. Copy the value of that cookie.

Setup the bot

  1. Edit config.js, replace COOKIE with the cookie you've just copied & TOKEN with your Discord bot's token
  2. 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

  1. Enable the Message Content Intent in your Discord Bot Portal - place where you obtain your bot token
  2. Set the value of messageCommand in config.js to true

You may now send !ask <PROMPT> in a server/guild, this is tantamount to the /ask slash command

Questions/Contributions

Feel free to create an issue for any help/concern. Contributions are always welcome, just create a pull request!

License

This project is available as an open source under the terms of the MIT License

About

Google Bard on Discord

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 95.3%
  • Dockerfile 3.1%
  • Shell 1.6%