GithubHelp home page GithubHelp logo

henrymxu / evebot Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 13.09 MB

E.V.E Bot is a Voice Enabled Discord Bot!

License: Apache License 2.0

Dockerfile 0.13% TypeScript 99.49% JavaScript 0.38%
discord discord-js

evebot's Introduction

E.V.E Bot

E.V.E

E.V.E is a voice enabled all in one discord bot. Feel free to host your own instance!

If you are a developer and wish to contribute / customize E.V.E, check out the wiki!

Table of Contents

Features

  • Play music!
  • Start a custom radio!
  • Clip or recite voice channel activity!
  • Say anything you want with the bot!
  • And much more!

Usage

  1. Add the bot to your Discord Server
  2. Use the ?help command to see the various command groups
    • Use the ?help command with a command name or group to see the command details (e.g ?help play)
  3. Say one of the provided hotwords to start a voice command (Alexa, Hey Siri, and OK Google)
    • Wait for the chime to start saying your command
    • Don't worry about other people interrupting you

Installation

The installation process for E.V.E is quite long due to all the different services it requires.

These steps are if you wish to run the bot on your local machine (i.e. PC, laptop). E.V.E runs on macOS and Linux (Windows has not been tested).

Pre Installation

  1. Retrieve all the required / desired tokens
  2. Install the following external dependencies
    • ffmpeg
    • lame (pre-installed on macOS)
    • node / npm (node >=12.0.0)
  3. Set up the environment variables and api tokens
    • Set up a json file with the key value pairs
    • An example can be found in example_keys.json
    • Environment variables can be used instead of a json file

Installation from NPM

  1. Install the package (npm install -g evebot)
  2. Start the bot using evebot <path to keys.json> (e.g evebot ~/Documents/keys.json)

Installation From Source

  1. Clone / Download the git repository (git clone [email protected]:henrymxu/evebot.git)
  2. Copy the json file you created above into the evebot directory
    • Rename this file to be keys.json
  3. Inside a terminal, navigate to the newly cloned evebot directory
  4. Install TypeScript (npm install -g typescript) and ts-node (npm install -g ts-node)
  5. Install the dependencies using npm install
  6. Start the bot using npm start

Local Installation with Docker

// TODO

Heroku Deployment

// TODO

Environment Variables

Name Environment Variable Description Required
Bot Environment bot_environment Informs the bot to use either 'development' or 'production' settings. Defaults to development.
Youtube Cookie youtube_cookie Required for the bot to bypass Youtube 429 Errors (Too many requests).

General API Tokens

Name Environment Variable Description Required
Discord Bot Token discord_token Required for the bot to login and communicate with discord.
Youtube Search API Token youtube_api_token Required for the bot to search for song URLs (Hopefully this will be converted to a scraper).
Genius API Token genius_token Required for the bot to find lyrics of songs.
Spotify API Tokens spotify_id Required for the bot to create radio playlists, search albums and playlists.
spotify_secret

Platform API Tokens

Details on how to authenticate and configure each provider can be found in each of their individual sections.

Summary

Name Speech-to-Text Text-to-Speech Cloud Storage
IBM Watson
Microsoft Azure
Google Cloud
Amazon Web Services

IBM Watson

Environment Variable Description
watson_token API Key
watson_url URL

Microsoft Azure

Environment Variable Description
microsoft_token KEY
microsoft_location LOCATION (e.g eastus)

Google Cloud

Environment Variable Description
google_keyFileCred Contents of the Google Cloud JSON Credentials File

Amazon Web Services

Environment Variable Description
AWS_REGION AWS Region
AWS_ENDPOINT Endpoint
AWS_ACCESS_KEY_ID Access Key ID
AWS_SECRET_ACCESS_KEY Secret Access Key

Configurations

Troubleshooting

  • The bot doesn't seem to recognize your voice commands

    • Wait until you hear the chime from the bot after saying the hotword to begin your voice command
    • Make sure the voice command doesn't get cut off by the ending chime
  • The bot seems to be unresponsive or not listening to any hotwords

    • Try using the rejoin command
  • The bot is unable to find any songs to play

Support

  • Feel free to create an issue on GitHub if there are any problems installing or using E.V.E!

License

This repository is licensed under Apache 2.0. You may host an instance of this bot for non-commercial and personal use free of charge.

evebot's People

Contributors

henrymxu avatar wahat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wahat

evebot's Issues

Implement dynamic voice command length

Is your feature request related to a problem? Please describe.
Users are sometimes cut off when saying a voice command, this is due to the voice command prompt only allowing a fixed length.

Describe the solution you'd like
Allow dynamic voice command length (potentially up to a maximum to prevent extremely long speech to text streams).

Describe context of feature
Changes to the ConnectionHandler to implement this.

Finish README

  • Missing detailed installation guide
  • Troubleshooting
  • Improve keys setup

Requesting help on an aliased command doesn't return the correct keyword

Describe the bug
If a command has an alias, and the alias is used in the help command, the help command returns an incorrect description

To Reproduce
e.g play is aliased with test, help test is used, the following message will use test as the keyword instead of play

Expected behaviour
help message uses the correct keyword (maybe it should show aliases in the message as well)

Standardize Acknowledgments

  • Errors on command execution should be thrown with an acknowledgement type or string
  • This error should be handled by the dispatcher
  • Execution function should return a Promise, that contains an appropriate acknowledgement type or string

Skip multiple songs at once

Is your feature request related to a problem? Please describe.
Want to skip multiple songs at once

Describe the solution you'd like
Allow skip command to skip multiple songs at once

Describe context of feature
Command improvement

Add option to start radio after playing a song

Is your feature request related to a problem? Please describe.
After playing a song with the play command with nothing in queue, the discord channel the bot was playing is filled with awkward silence

Describe the solution you'd like
I would like to have the option to start a spotify radio after my requested song is played to fill in this void.

Describe context of feature
Add an option to start a spotify radio in the play command
ex. -play blackpink lovesick girls -radio

Additional context
u mam

Snowboy Deprecation

With Snowboy deprecation coming soon, and Porcupine's introduction of Alexa / OK Google / Hey Siri, Snowboy likely does not to be included / used in the library.

Pros:

  • Reduce node dependencies
  • Reduce linux dependencies

Cons:

  • One less reference for hotword detection

Improve Table messages

  • Large table messages are split across multiple messages, this is unappealing and might be considered spammy in some servers
  • Once #28 has been closed, add an option to scroll through the table by reacting to the message (similar to Groovy)

Improve Bot Acknowledgement

Is your feature request related to a problem? Please describe.
More standardized bot acknowledgement (i.e reacting with emojis)

Describe the solution you'd like
Define different acknowledgement types, allow users to customize the emojis that represent each acknowledgement type

Describe context of feature
Improvement to existing feature

Additional context
Users should be able to customize the emojis through configs

Shuffle Queue Feature

  • Add option to shuffle queue
  • Add this option to queueing playlists / albums as well

Resolve Playlist / Album songs later

Issue

Currently when a playlist / album is queued, every song is passed through YTDL-core to determine whether or not a valid song can be found. This can cause issues when large playlists / albums are queued as it takes a while to resolve all these songs.

Fix

Possibly only resolve the first 5? or so songs in the playlist / album, then as songs are removed from the queue, resolve another one in the background

Voice Receiving causing crash when user on browser joins

Describe the bug
DiscordJS attempts to decode corrupted packet (from user joining from browser). This error is not handled to the bot crashes

To Reproduce
Have user join on browser and say something, bot will then crash with error:

/evebot/node_modules/prism-media/src/opus/Opus.js:64
    return this.encoder.decode(buffer, Opus.name === 'opusscript' ? null : this._options.frameSize);
                        ^
TypeError: The compressed data passed is corrupted
    at Decoder._decode (evebot/node_modules/prism-media/src/opus/Opus.js:64:25)
    at Decoder._transform (evebot/node_modules/prism-media/src/opus/Opus.js:189:20)
    at Decoder.Transform._read (_stream_transform.js:191:10)
    at Decoder.Transform._write (_stream_transform.js:179:12)
    at doWrite (_stream_writable.js:403:12)
    at writeOrBuffer (_stream_writable.js:387:5)
    at Decoder.Writable.write (_stream_writable.js:318:11)
    at Readable.ondata (_stream_readable.js:695:22)
    at Readable.emit (events.js:310:20)
    at Readable.EventEmitter.emit (domain.js:482:12)

Expected behaviour
Should not crash

Bot Configuration:

  • OS: [e.g. macOS, Ubuntu]
  • SpeechEngines (if applicable)
  • HotwordEngines (if applicable)
  • Database (if applicable)

Additional context

Created Issue on DiscordJS Repo here

Implement option to opt-out of voice commands

Is your feature request related to a problem? Please describe.
Some people may not wish to have the bot always be listening to them

Describe the solution you'd like
Provide a way to opt out of the bot listening to them

Describe context of feature
Configuration command (i.e add user ids to array)

Additional context
Users would not be able to access voice commands

Implement feature to allow user to acknowledge bot messages

Is your feature request related to a problem? Please describe.
No way for bot to ask user to do something (i.e if radio is done, allow user to react to a message and bot will retrieve some more songs)

Describe the solution you'd like
Allow commands to request users to acknowledge a response in order to complete a commnad

Describe context of feature
Bot responds with a message, user reacts to it, bot then performs an action based on reaction

Additional context

Determine command execution time

  • Curious to see how long command execution takes (from message to response)
  • Should be straight forward to implement using dispatcher and command execution
  • Would be nice to store these execution times in order to find improvements

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.