GithubHelp home page GithubHelp logo

superzackx / voiceactivatedbots Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 56 KB

An attempt to make bots.

License: Creative Commons Zero v1.0 Universal

JavaScript 92.24% HTML 7.76%
bot ai voice-api voice javascript speak easy code html js

voiceactivatedbots's Introduction

๐Ÿ‘‹ Hi, Iโ€™m Yash Bhatnagar

  • ๐Ÿ‘€ Iโ€™m passionate about programming, football and gaming.
  • ๐ŸŒฑ Iโ€™m currently learning solidity and smart contracts.
  • ๐Ÿ“ซ Shoot me an email at [email protected].

๐Ÿ›  Tech Stack

Solidityย  Node.jsย  Pythonย  C++ย  HTMLย  CSSย  JavaScriptย  Linuxย  Gitย  GitHubย 

โš™๏ธ GitHub Stats

voiceactivatedbots's People

Contributors

nigamanthsrivatsan avatar superzackx avatar

Watchers

 avatar

voiceactivatedbots's Issues

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!

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?

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

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.