guildMemberAdd Updated
This commit is contained in:
1 parent
3077772aff
commit
63b08f8c12
1 file changed
+7
-7
@@ -7,25 +7,25 @@ const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
|
||||
module.exports = async (bot) => {
|
||||
module.exports = async (bot, member) => {
|
||||
|
||||
if (supportbot.SystemMessages === "true") {
|
||||
const SystemChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.SystemMessage_Channel)
|
||||
const SystemChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.SystemMessage_Channel)
|
||||
|
||||
if (!SystemChannel) return;
|
||||
|
||||
if (supportbot.SystemMessage_Type === "embed") {
|
||||
const GuildAddMember = new Discord.MessageEmbed()
|
||||
.setTitle(supportbot.Welcome_Title)
|
||||
.setDescription(supportbot.WelcomeMessage.replace(/%member%/g, message.member.user.username).replace(/%guildname%/g, guild.name))
|
||||
.setDescription(supportbot.WelcomeMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
||||
.setColor(supportbot.EmbedColour)
|
||||
|
||||
if (supportbot.WelcomeMessage_Icon === "BOT") {
|
||||
GuildAddMember.setThumbnail(message.author.displayAvatarURL())
|
||||
GuildAddMember.setThumbnail(bot.displayAvatarURL())
|
||||
}
|
||||
|
||||
if (supportbot.WelcomeMessage_Icon === "USER") {
|
||||
GuildAddMember.setThumbnail(message.member.displayAvatarURL())
|
||||
GuildAddMember.setThumbnail(member.displayAvatarURL())
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ module.exports = async (bot) => {
|
||||
}
|
||||
|
||||
if (supportbot.SystemMessage_Type === "normal") {
|
||||
SystemChannel.send(supportbot.WelcomeMessage.replace(/%member%/g, message.member.user.username).replace(/%guildname%/g, guild.name))
|
||||
SystemChannel.send(supportbot.WelcomeMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
||||
|
||||
if (supportbot.AutoRole === "true") {
|
||||
member.roles.add(supportbot.AutoRole_Role)
|
||||
|
||||
Reference in new issue
Block a user