Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bot.on('message', function (user, userID, channelID, message, evt) {
- if (userID != "<513501693753688066>") {
- if (message.includes("status report")) {
- bot.sendMessage({
- to: channelID,
- message: "Did you submit your status report to the administrator today?"
- });
- } else if (message.includes("the core")) {
- bot.sendMessage({
- to: channelID,
- message: "Release date: unknown"
- });
- }
- }
- // Our bot needs to know if it will execute a command
- // It will listen for messages that will start with `!`
- if (message.substring(0, 1) == '!') {
- var args = message.substring(1).split(' ');
- var cmd = args[0];
- args = args.splice(1);
- switch(cmd) {
- // !twhl
- case 'twhl':
- bot.sendMessage({
- to: channelID,
- message: 'Up and ready!'
- });
- break;
- // !sledge
- case 'sledge':
- bot.sendMessage({
- to: channelID,
- message: 'You can download **Sledge** here: http://sledge-editor.com/'
- });
- break;
- // !sharplife
- case 'sharplife':
- bot.sendMessage({
- to: channelID,
- message: 'You can check **Sharp-Life** here: https://github.com/SamVanheer/SharpLife-Engine'
- });
- break;
- // !compo
- case 'compo':
- bot.sendMessage({
- to: channelID,
- message: '**There are no competitions running at the moment.**'
- });
- break;
- // !wiki
- case 'wiki':
- bot.sendMessage({
- to: channelID,
- message: '**The wiki contains all of the collective knowledge that the community has acquired over the years**: https://twhl.info/wiki'
- });
- break;
- // !vault
- case 'vault':
- bot.sendMessage({
- to: channelID,
- message: 'TWHL\'s Map **Vault**: https://twhl.info/vault'
- });
- break;
- // Just add any case commands if you want to..
- }
- }
- });
- bot.on('guildMemberAdd', function(member) {
- bot.sendMessage({
- to: '291678871856742400',
- message: `Hi <@${member.id}>! :wave: Welcome to the **TWHL Discord Server**! :slight_smile:`
- });
- });
- bot.on('guildMemberRemove', function(member) {
- bot.sendMessage({
- to: '291678871856742400',
- message: `<@${member.id}> just leaved us... :cry:`
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement