Giter VIP home page Giter VIP logo

voiceactivatedbots's Introduction

VoiceActivatedBots

Voice activated bots! The name explains it. ๐Ÿค–๐Ÿฅ๐Ÿค–

Usage

To use, simply download the files and then open the test.html file in your browser. It will show an request for microphone, accept that. All the logic and JavaScript is in app.js

Or you can use the CDN version which offers everything except for the latest OOP version.

https://cdn.jsdelivr.net/gh/superzackx/VoiceActivatedBots@latest/CDN/script.js

Contributions

To contribute to this repo, clone it on your PC and open an issue with the link to the modified version. I will look into it!

Notes

Voice API will not work in internet explorer! Please use supported browsers such as Google Chrome and Microsoft Edge.

Credits

  1. superzackx(Yash) - That's me! I made this fully. So whenever your bot does something for you, keep me in mind! Just kidding, have fun with the bot. Developing is all about open-source.

  2. NightZan999 - A great person who has done a lot for this project. Mainly the OOP part.

Exlplore the voice API

Link for MDN reference: https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API

voiceactivatedbots's People

Contributors

nigamanthsrivatsan avatar superzackx avatar

Watchers

 avatar

voiceactivatedbots's Issues

Scopes

Variable Scopes

I hope you know that in Vanilla Javascript, the var keyword is at local scope. Inside of functions using vars is just silly because you don't want it in other parts of your code. Using the let keyword inside your functions would be better.

Also inside functions you would not need any arguments if you replace var with const. That way it would be cleaner and better for people like me to read. (I am not the best at JS, but heres a suggestion)

Thanks and Regards,
NightZan999

OOP when?

We all know that for a bot and if your planning to make many of them. You would obviously need to categorize them into a separate data type (classes).

Your functions look nice, why don't you just make a class called "Bot" and then put all the functions into methods, by using this method you can easily reuse your code by polymorphism!

Then you can make bots easier, secondly can you please make this into an NPM package so that people can download it with npm rather than git?

Async callbacks throw errors

This is when we started OOP specifically in the 2nd latest commit. The async callbacks is equivalent to hell in javascript.
The way to fix this issue is to redesign how the model class works.

Through my testing folder I figured out that FS loads even the tests, that is when I figured out this bug. Read this article for more information on the same issue: https://blog.risingstack.com/node-js-async-best-practices-avoiding-callback-hell-node-js-at-scale/

That shows how async callbacks work, all async methods return Promise, I highly recommend installing the JS code snippets for VS Code.

To fix this we can't have any normal functions which don't return promises. That means we have to replace all functions with async and await.

Then we should not be getting into errors, we also should upload in a testing folder so that we don't actually mess something else up. The model class is just an abstract class pretty much because we can use that model to have child classes and then get some prebuilt methods! So please don't edit the model class!

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.