Wednesday 19 July 2017

Newbie Code Review

Hey guys, I'm a newbie to node/js and my first (and most fun ) project is making a discord bot with node. It's gone decent and the bot doesn't seem to have nearly as many issues as it used to, but I can't figure out how to make it better, yet.I'm gonna post a few command files here that I feel like aren't that great, can you review them for me and explain what I could do better? Be warned, it's a bot based around shitposts and memes.Command Name: AnnoyUse: Annoys a target user, or yourself if you forget to target someone.Potential Problems? This code feels repetitive and ugly, and I'm not sure how to make it better.Code: http://ift.tt/2uJd8BA Name: TweetUse: User can send a tweet from the memebot's accountPotential Problems? The command feels slow and buggy, but I can't figure out whyCode: http://ift.tt/2vjtTA2 Name: app.jsUse: This file handles incoming messages, and a few other things.Potential Problems? I'm just not sure about my code style here, (I like no semicolons though), basically I just don't know if what I'm doing is actually good practice and best for performance. I feel like I'm not using async/await to it's full potential, and sometimes the bot seems to leak ram and it would probably come from this file.Code: http://ift.tt/2uJ27jr you could help me learn by giving me an honest review/advice, I'd really appreciate it! <3

Submitted July 19, 2017 at 04:41PM by Kerdaloo

No comments:

Post a Comment