discord-voice-assistant-bot icon indicating copy to clipboard operation
discord-voice-assistant-bot copied to clipboard

A bot that hangs out in Discord and sometimes talks to Google Assistant.

Discord Google Assistant Bot

A bot that hangs out in Discord and sometimes talks to Google Assistant.




Features

Discord Bot

  • Hangs out in the voice chat, plays music from YouTube, SoundCloud, etc. through youtube-dl.
  • Responds to guild messages with custom user-defined responses available through an easily-accessible Google Sheets link.

Google Assistant Action

  • Google Assistant intent for asking which members of a Discord guild are online.

Installation

  • Create a Discord bot account and invite it to your server.
  • cd to the project directory.
  • Run the installation script. Linux & Mac: install.sh Windows: python3 install.py
  • Note: The bot's dependencies require that you use Python 3.6!
  • The bot's command prefix defaults to .. This can be configured to suit your guild's needs.
  • Note: Some low-level dependencies such as ffmpeg may not be pip-able on your system. You'll need to install these dependencies yourself.

Google Assistant Setup

If you want to use Google Assistant features, follow the Dialogflow setup instructions. Set the fulfillment URL to point to your hosted index.py.

  • If you need free web hosting, you host your web service locally and expose a port to the web using a tool like Serveo.

Custom Bot Responses

The bot uses Google Sheets as a shared database of custom responses. This Sheet can be edited on-the-fly to setup custom bot text or audio responses to text typed in the Discord channels.

Create a new Sheet and configure a service account for the bot following this tutorial. If you wish, share the link with your guild's members to allow them to add their own flavor to the bot.

Note: The video tutorial states to use the Google Drive API; use the Google Sheets API instead. All other steps are the same.


Usage

Regular bot

The bot can be run without any fancy Google Assistant functionality.

Linux & Mac: bot_service.sh Windows: python3 bot_service.py

Optional Arguments: dev - supress announcing the bot's online status

Google Assistant mode

Run the Sanic server with python3 bot/index.py. This will run the web server at http://localhost:8000.

If you're hosting the bot elsewhere, run the server the way you're used to. You may need to edit the configuration in index.py.

Type <command_prefix> help to see what the bot can do!

Roadmap

  • More bot features. Got an idea? Open an issue!

Attribution

  • Powered by discord.py.
  • Formatting for the help command is modified from the example provided by discord.py.