buddy

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 430320067b5aecd29d7fa48f683ec4052fdd8ea7
parent 37ec1fdfab35a40f841966325cf5b15ff39b775a
Author: underd0g1 <hide4@comcast.net>
Date:   Thu, 10 Sep 2020 02:04:40 -0400

added member event

Diffstat:
Mbuddy1.js | 73+++++++++++++------------------------------------------------------------
Mevents/member.js | 12++++++++++++
2 files changed, 25 insertions(+), 60 deletions(-)

diff --git a/buddy1.js b/buddy1.js @@ -17,74 +17,27 @@ const apiroute = require('./lib/3party.js'); const init = require('./events/ready.js'); const message = require('./events/message.js'); const processing = require('./lib/processing.js'); +const member = require('./events/member.js'); init.startup(client); message.internalResponse(client, processing); +member.newmember(client) + + + +// client.on('guildMemberAdd', member => { +// // Send the message to a designated channel on a server: +// const channel = member.guild.channels.find(ch => ch.name === 'member-log'); +// // Do nothing if the channel wasn't found on this server +// if (!channel) return; +// // Send the message, mentioning the member +// channel.send(`Welcome to the server, ${member}`); +// }); -// client.on('message', (receivedMessage) => { -// if (receivedMessage.author == client.user){ -// return -// } -// //receivedMessage.channel.send("message received, " + receivedMessage.author.toString() + ": " + receivedMessage.content) -// if (receivedMessage.content == 'hi buddy'){ -// receivedMessage.react("🤚") -// receivedMessage.channel.send('whats good ' + receivedMessage.author) -// }else if(receivedMessage.content.includes('buddy')){ -// receivedMessage.channel.send('hi'); -// }else if(receivedMessage.content.includes('buddy' && 'fuck')){ -// receivedMessage.channel.send('aahhhh my virgin ears!') -// }else if (receivedMessage.content.includes('hi')){ -// receivedMessage.channel.send('hi' + " " + receivedMessage.author) -// } -// -// if(receivedMessage.content.startsWith("!")){ -// processCommand(receivedMessage) -// } -// //receivedMessage.react("🤚") -// }) - - -client.on('guildMemberAdd', member => { - // Send the message to a designated channel on a server: - const channel = member.guild.channels.find(ch => ch.name === 'member-log'); - // Do nothing if the channel wasn't found on this server - if (!channel) return; - // Send the message, mentioning the member - channel.send(`Welcome to the server, ${member}`); -}); - - - -// // add to handlers folder (events.js) -// async function processCommand(receivedMessage){ -// -// let fullCommand = receivedMessage.content.substr(1) -// let splitCommand = fullCommand.split(" ") -// let primaryCommand = splitCommand[0] -// let arguements = splitCommand.slice(1) -// -// if (primaryCommand == "help"){ -// helpCommand(arguements, receivedMessage) -// }else if (primaryCommand == "multiply"){ -// multiplyCommand(arguements, receivedMessage) -// }else if(primaryCommand == "iss"){ -// receivedMessage.channel.send(await apiroute.iss()); -// }else if(primaryCommand == "joke"){ -// receivedMessage.channel.send(await apiroute.joke()); -// }else if(primaryCommand == "code"){ -// receivedMessage.channel.send(await apiroute.code()); -// }else if(primaryCommand == "beer"){ -// receivedMessage.channel.send(await apiroute.beer()); -// }else if(primaryCommand == "foas"){ -// receivedMessage.channel.send(await apiroute.foas1()); -// }else{ -// helpCommand(arguements,receivedMessage) -// } -// } function multiplyCommand(arguements, receivedMessage){ diff --git a/events/member.js b/events/member.js @@ -1 +1,13 @@ +const newmember = async(client)=>{ + client.on('guildMemberAdd', member => { + // Send the message to a designated channel on a server: + const channel = member.guild.channels.find(ch => ch.name === 'member-log'); + // Do nothing if the channel wasn't found on this server + if (!channel) return; + // Send the message, mentioning the member + channel.send(`Welcome to the server, ${member}`); + }); + }) + + module.exports={newmember}