Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
hopefully this goes to the correct spot this time
  • Loading branch information
James Taber authored and James Taber committed May 8, 2018
commit 9faaa0a975f7b4955b0212f81e537ef750fac4d2
8 changes: 8 additions & 0 deletions bot/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ client.on('ready', () => {
util.log('Bot Online and Ready', 0);
});

// Message for new users
Copy link
Contributor

@brennondenny brennondenny May 18, 2018

Choose a reason for hiding this comment

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

Remove the old Welcome Feature, this should only include code for the live stream notification.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for this I am removing it now

client.on('guildMemberAdd', (member) => {
// Send Direct Message with Terms of Service
member.send(`Welcome ${member.user.username} to the family! Please read our Terms of Service`);
// Send Welcome User Message in the General Channel
member.guild.channels.find('name', 'general').send(`Welcome ${member.user.username} to the Family!`);
});

// Listen for messages
client.on('message', (message) => {
// Check for ! prefix on message to ensure it is a command
Expand Down
28 changes: 28 additions & 0 deletions bot/controllers/tosWelcome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const BaseController = require('../baseController.js');
const Command = require('../baseCommand.js');

class TosController extends BaseController {
constructor(message) {
// Call BaseController constructor
super(message);
// Aliasing 'this' as controller to allow for binding in actions
const controller = this;
// Array of all commands, see baseCommand.js for prototype
this.commands = [
new Command(
'!tos',
'!tos',
'Resend Terms',
'Send Terms Copy',
this.welcomeAction.bind(controller),
'dm',
),
];
}
// Sends the welcome message to the user
welcomeAction() {
const { message } = this;
return `Welcome ${message.author.username} to the server! Please read our Terms of Service. If you want to receive the terms again just type !tos`;
}
}
module.exports = TosController;