Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #1

Open
wants to merge 11 commits into
base: stable
Choose a base branch
from
Open

Master #1

wants to merge 11 commits into from

Conversation

acrylic-style
Copy link
Member

No description provided.

Copy link
Member

@yuta0801 yuta0801 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the code but not running, so check the runtime error yourself

index.js Outdated

client.on('message', async msg => {
const guild = await data.getServer(msg.guild.id).then(g => g.toJSON())
const user = await data.getUser(msg.author.id).then(u => u.toJSON())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to use toJSON?
AFAIK, it provides getters so you can access data directly without converting to plain object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know this at that moment but I know this now, so I'll fix this.

if (args[1] === 'config') {
if (args[2] === 'set') {
if (!args[4]) sendDeletable('Not enough args.')
const config = require(__dirname + '/../config.yml')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that this may be cached

@yuta0801
Copy link
Member

yuta0801 commented Sep 4, 2019

Other improvement plan:

  • Improve readability
    • Use class methods instead of the inline function
    • Reduce reassignment and assign to the appropriate variable name
  • Make it even more like a framework
    • Manage internally Discord.js client, events and command handlers
    • Make it explicitly behavior. Partially hidden behavior is difficult to understand
    • Create a class inheriting Message that bundles sendDeletable, languages, etc.
    • Integration with emojis, logger, etc.

@acrylic-style
Copy link
Member Author

I read the code but not running, so check the runtime error yourself

Wait, it's running for me(with latest master branch commit); what's the error you got?

@yuta0801
Copy link
Member

yuta0801 commented Sep 6, 2019

@acrylic-style I can't get any error because didn't run the bot, so runtime errors checks are not included in this review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants