Giter Club home page Giter Club logo

dude-bot's Introduction

Dude-Bot

Installation

MAC OS GUIDE

Make sure you have recording and python installed

$ sudo apt-get install libav-tools portaudio19-dev python-setuptools easy_install pip

Install pyvona and its dependencies

$ sudo pip install pyvona requests pygame

Install virtualenv

$ sudo apt-get install python-virtualenv

[optional](see Usage)

Download and Install wolframAlpha python library

$ sudo python setup.py build

$ sudo python setup.py

Usage

Create a virtual environment and install wolframalpha (if you didn't before) and pyramid.

$ mkdir venv
$ export VENV=path-to-your-dir/venv
$ virtualenv --system-site-packages $VENV
$ . $VENV/bin/activate
$ $VENV/bin/pip install wolframalpha
$ $VENV/bin/pip install "pyramid==1.7.3"

Get an WolframAlpha API APP-ID

Get an IVONA Speech Cloud Account and generate credentials: Access and Secret Key

Create configuration file config.cfg at project root

[main]
app_id = YOUR-APIKEYHERE
access_key = IVONA_ACCESS_KEY
secret_key = IVONA_SECRET_KEY

Edit the bot configuration file bot_config.json at project root

{
	"triggers": ['dude', 'hey dude', 'hey mate', 'ok dude', 'okay dude'],
	"greetings": ["Sire?", "One is glad to be of service!", "How can I help?", "What is it!?! Can't you see I'm busy?", "WHAT???"],
	"voice": {"voice_name": "Brian", "language": "en-GB", "gender": "Male"}
}
  • triggers: the triggers that "wake" the bot (words you say so that the bot know you want to execute a command)
  • grettings: the bot responses to being woken
  • voice: the voice configuration from ivona

Note

Before running check your pyOpenSSL version. It needs to be >= 0.14.

Run this to check the version:

$  python -c 'import OpenSSL; print(OpenSSL.__version__)'

Run this to update it:

$ sudo pip install -U pyOpenSSL

Run

$ $VENV/bin/python api_dudebot.py

The app will start listening on port: 8080. Open the browser into localhost:8080 and you should see the bot.

Note

Run in Google Chrome has this uses Speech Recognition API and currently only Chrome and Opera have partial support for it.

Add New Commands

In order to add new commands go into the commands folder and create the following structure:

commands/
 └─── new_command/
      |- __init__.py
      │- new_command.py
  • Create a new folder with the command name for simplicity
  • Add an empty __init__.py file
  • Add a new python file with the command name (again for simplicity reasons) where you'll add your code
  • Inside main_commands.py import the functionality created and edit the function process_command in order to call your functionality
  • Add the command to the bot configuration file in bot_config.json. Format:
"command": {
  "triggers": [
    "words",
    "that",
    "will",
    "trigger",
    "this",
    "command"
  ],
  "message": true or false
}
  • triggers: the words that will trigger the command

  • message: if the the command expects more input other than the trigger set this to true if not set it to false

  • Check the ping command for an simple example

Docs

docs

Resources

dude-bot's People

Contributors

a31859 avatar efmr avatar

Watchers

James Cloos avatar Simon avatar Koen Betsens avatar Miguel Sousa avatar Rui Molefas avatar António Simões avatar  avatar Gonçalo Santos avatar Cláudio Alves avatar Erick Rettozi avatar Alvin avatar  avatar

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.