Skip to content

Conversation

@Kaptard
Copy link
Member

@Kaptard Kaptard commented Sep 3, 2017

Moved basic error logging to main.js as global exception handler. (no more .catch(this.logger.error))
Made use of ES7 async in the main modules for now. I recommend testing this, before starting with commands. (Will append commits to this PR)

@TobiTenno
Copy link
Member

fix for #117

@TobiTenno TobiTenno added the Status: In Progress Work has Begun label Sep 5, 2017
@Kaptard
Copy link
Member Author

Kaptard commented Sep 6, 2017

Just looked through c5ca908 and noticed there's a lot of async usage without actually awaiting anything. With help.js as example, did you mean to wait until each of those embeds are finished and only then return this.messageManager.statuses.SUCCESS?

@TobiTenno
Copy link
Member

It's intended for help, that needs a further rewrite right now as it is, so i'm waiting for other enhancements on that one for afterward.

Copy link
Member

@TobiTenno TobiTenno left a comment

Choose a reason for hiding this comment

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

Just a couple small changes or talking points for us.

Do we want to finish this pass on the commands, do the core utilities like database/settings and messageManager and then come back and do a second pass on the commands?

.then(() => this.messageManager.reply(message, 'New avatar set!', true, true))
.catch(this.logger.error);
await this.bot.client.user.setAvatar(url);
this.messageManager.reply(message, 'New avatar set!', true, true);
Copy link
Member

Choose a reason for hiding this comment

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

could you add the success returns for when it succeeds when the message is sent?

const guild = await this.bot.client.guilds.get(serverid).leave();
this.messageManager.reply(message, `Left ${guild.name}`, true, true);
} else {
message.reply('No such guild cached');
Copy link
Member

Choose a reason for hiding this comment

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

similar to Avatar, could you have an ❌ response after 'No such guild cached'?

const commandsRemovedString = commandsRemoved.length > 0 ? commandsRemoved.sort().join(' ') : ' No Commands Removed';

this.messageManager.sendMessage(message, `${this.md.codeMulti}Commands reloaded!${this.md.blockEnd}` +
await this.messageManager.sendMessage(message, `${this.md.codeMulti}Commands reloaded!${this.md.blockEnd}` +
Copy link
Member

Choose a reason for hiding this comment

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

we probably want to look at returning the values from the operations in the messageManager functions so that these and successes make more sense.

const longest = roles.map(role => role.name)
.reduce((a, b) => (a.length > b.length ? a : b));
const groupedRoles = createGroupedArray(roles, 20);
const metaGroups = createGroupedArray(groupedRoles, 4);
Copy link
Member

Choose a reason for hiding this comment

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

this is more a criticism of my own code, but we could probably just wrap the second createGroupedArray call around the result of the first, since the first isn't used independently.

? `${player.marked.stalker ? '<:stalker:330021480169603076>' : ''} ` +
{
name: 'Current Mastery',
value: player.mastery.xp,

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

{
name: 'Current Mastery',
value: player.mastery.xp,
inline: true,

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

name: 'Current Mastery',
value: player.mastery.xp,
inline: true,
},

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 6. (indent)

value: player.mastery.xp,
inline: true,
},
{

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 6. (indent)

inline: true,
},
{
name: 'Next Rank',

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

},
{
name: 'Next Rank',
value: `${player.mastery.xpUntilNextRank} until **${player.mastery.rank.next}**`,

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

{
name: 'Next Rank',
value: `${player.mastery.xpUntilNextRank} until **${player.mastery.rank.next}**`,
inline: true,

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

name: 'Next Rank',
value: `${player.mastery.xpUntilNextRank} until **${player.mastery.rank.next}**`,
inline: true,
},

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 6. (indent)

value: `${player.mastery.xpUntilNextRank} until **${player.mastery.rank.next}**`,
inline: true,
},
{

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 6. (indent)

inline: true,
},
{
name: 'Clan',

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

},
{
name: 'Clan',
value: player.clan.type ? `${player.clan.name}\nRank **${player.clan.rank}** ${player.clan.type}` : player.clan.name,

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

{
name: 'Clan',
value: player.clan.type ? `${player.clan.name}\nRank **${player.clan.rank}** ${player.clan.type}` : player.clan.name,
inline: true,

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

name: 'Clan',
value: player.clan.type ? `${player.clan.name}\nRank **${player.clan.rank}** ${player.clan.type}` : player.clan.name,
inline: true,
},

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 6. (indent)

value: player.clan.type ? `${player.clan.name}\nRank **${player.clan.rank}** ${player.clan.type}` : player.clan.name,
inline: true,
},
{

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 6. (indent)

inline: true,
},
{
name: 'Marked for Death',

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

},
{
name: 'Marked for Death',
value: (player.marked.stalker || player.marked.g3 || player.marked.zanuka)

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

inline: true,
});
: 'Unmarked',
inline: true,

Choose a reason for hiding this comment

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

Expected indentation of 10 spaces but found 8. (indent)

});
: 'Unmarked',
inline: true,
});

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 6. (indent)

* Raven client for logging errors and debugging events
* @type {Raven}
*/
const NexusFetcher = require('nexus-stats-api');

Choose a reason for hiding this comment

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

Unable to resolve path to module 'nexus-stats-api'. (import/no-unresolved)

* Raven client for logging errors and debugging events
* @type {Raven}
*/
const NexusFetcher = require('nexus-stats-api');

Choose a reason for hiding this comment

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

Unable to resolve path to module 'nexus-stats-api'. (import/no-unresolved)

another attemp to fix false positive (this is only happening on stickler-ci, so no idea why)
@TobiTenno
Copy link
Member

merging.

@TobiTenno TobiTenno merged commit cfdda08 into WFCD:master Sep 19, 2017
@TobiTenno TobiTenno removed the Status: In Progress Work has Begun label Sep 19, 2017
@wfcd-bot-boi
Copy link
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants