Skip to content

Added New Welcome Message and !tos Command#146

Closed
brennondenny wants to merge 8 commits intodevfrom
feature-welcome-command
Closed

Added New Welcome Message and !tos Command#146
brennondenny wants to merge 8 commits intodevfrom
feature-welcome-command

Conversation

@brennondenny
Copy link
Contributor

No description provided.

@mattpezzente
Copy link

No errors, all tests pass. Consider changing the user messages to incorporate tagging and mentions of the username so that the user can be notified around the channel.

@BHess2653
Copy link

Looks good to me everything worked all tests passed.

Copy link
Owner

@reactivepixel reactivepixel left a comment

Choose a reason for hiding this comment

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

Very good work, only small items to be addressed. These small touches of tone are something that once you are thinking about you will start to naturally bake these into the features you are developing.

bot/client.js Outdated
// Send Direct Message with Terms of Service
member.send(`Welcome ${member} to the Full Sail Armada! Read our Terms of Service`);
// Send Welcome User Message in the General Channel
member.guild.channels.find('name', 'general').send(`Welcome ${member} to the Full Sail Armada!`);
Copy link
Owner

Choose a reason for hiding this comment

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

When we bury strings inside of code that has been chained, even somewhat non-complex code, we make it hard to maintain the text messages we are trying to send. This is strongly related to magic numbers in that if we implement a variable, and control that string within, using the variable on the sending of the message method will come out cleaner. If you look at the email being sent in the verify controller you can see how quickly inline strings used in this manner begin to degrade.

const targetChannel = 'general';
const greeting = 'Welcome ${member.user.username} to the Family!';

// Send Welcome User Message in the General Channel
member.guild.channels.find('name', targetChannel).send(greeting);

'!tos',
'!tos',
'Terms of Service',
'Send Copy of the Terms of Service',
Copy link
Owner

Choose a reason for hiding this comment

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

Where is this copy sent? Does it send it to the channel? We need to shape our messages to the user carefully and accurately so that we craft an expected user experience.

tosAction() {
// Send Direct Message with the Terms of Service
const { message } = this;
return `<@${message.author.id}> read our Terms of service`;
Copy link
Owner

Choose a reason for hiding this comment

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

This is a different welcome message than originally sent.

bot/client.js Outdated
// Message for new users
client.on('guildMemberAdd', (member) => {
// Send Direct Message with Terms of Service
member.send(`Welcome ${member} to the Full Sail Armada! Read our Terms of Service`);
Copy link
Owner

Choose a reason for hiding this comment

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

Duplicate code logic in your controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I understand correctly you are talking about the direct message here being the same as the direct message in my tos.js tosAction. I see that I could fire off the tosAction inside here but that would require me to import my specific controller, TosController. Is this your preferred way to solve the issue?

@reactivepixel reactivepixel deleted the feature-welcome-command branch August 21, 2019 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants