Skip to content

Master#1

Open
acrylic-style wants to merge 11 commits into
stablefrom
master
Open

Master#1
acrylic-style wants to merge 11 commits into
stablefrom
master

Conversation

@acrylic-style

Copy link
Copy Markdown
Member

No description provided.

@yuta0801 yuta0801 left a comment

Copy link
Copy Markdown
Member

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

Comment thread 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
Copy Markdown
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
Copy Markdown
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.

Comment thread commands/fuck.js
if (args[1] === 'config') {
if (args[2] === 'set') {
if (!args[4]) sendDeletable('Not enough args.')
const config = require(__dirname + '/../config.yml')

Copy link
Copy Markdown
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

yuta0801 commented Sep 4, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
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

yuta0801 commented Sep 6, 2019

Copy link
Copy Markdown
Member

@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