Skip to content
Snippets Groups Projects
Commit e3425622 authored by Reviath's avatar Reviath
Browse files

Update bot.js

parent 7a855e95
Branches
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ client.unloadCommand = async (commandName) => {
client.on('guildMemberAdd', async member => {
var channel = "";
const welcomech = await new Promise((resolve, reject) => {
connection.query(`SELECT channel FROM guildmemberadd WHERE guildid ='${message.guild.id}'`, function (err, result) {
connection.query(`SELECT channel FROM guildmemberadd WHERE guildid ='${member.guild.id}'`, function (err, result) {
if (err)
reject(err);
resolve(result);
......@@ -87,7 +87,7 @@ else {
}
var welcmmsg = "";
const welcomemsg = await new Promise((resolve, reject) => {
connection.query(`SELECT msg FROM memberaddmsg WHERE guildid ='${message.guild.id}'`, function (err, result) {
connection.query(`SELECT msg FROM memberaddmsg WHERE guildid ='${member.guild.id}'`, function (err, result) {
if (err)
reject(err);
resolve(result);
......@@ -103,7 +103,7 @@ let a = member.guild.channels.cache.get(channel)
a.send(welcmmsg ? welcmmsg.replace('{mention}', `${member}`).replace('{username}', `${member.user.username}`) : ``);
var role = "";
const autorole = await new Promise((resolve, reject) => {
connection.query(`SELECT roleid FROM autorole WHERE guildid ='${message.guild.id}'`, function (err, result) {
connection.query(`SELECT roleid FROM autorole WHERE guildid ='${member.guild.id}'`, function (err, result) {
if (err)
reject(err);
resolve(result);
......@@ -122,7 +122,7 @@ member.roles.add(role2)
client.on('guildMemberRemove', async member => {
var channel = "";
const leavech = await new Promise((resolve, reject) => {
connection.query(`SELECT channel FROM guildmemberremove WHERE guildid ='${message.guild.id}'`, function (err, result) {
connection.query(`SELECT channel FROM guildmemberremove WHERE guildid ='${member.guild.id}'`, function (err, result) {
if (err)
reject(err);
resolve(result);
......@@ -136,7 +136,7 @@ else {
}
var leavemsg = "";
const leavemsg2 = await new Promise((resolve, reject) => {
connection.query(`SELECT msg FROM memberremovemsg WHERE guildid ='${message.guild.id}'`, function (err, result) {
connection.query(`SELECT msg FROM memberremovemsg WHERE guildid ='${member.guild.id}'`, function (err, result) {
if (err)
reject(err);
resolve(result);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment