change/explicit-ban-function-names
This commit is contained in:
4 files changed
+19
-8
No files matched your search
@@ -1,4 +1,4 @@
|
||||
const { HandlePlayerBan } = require('./NitradoAPI');
|
||||
const { BanPlayer, UnbanPlayer } = require('./NitradoAPI');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
@@ -32,7 +32,7 @@ module.exports = {
|
||||
|
||||
channel.send({ content: `<@&${alarm.role}>`, embeds: [alarmEmbed] });
|
||||
|
||||
HandlePlayerBan(client, data.player, true);
|
||||
BanPlayer(client, data.player);
|
||||
}
|
||||
|
||||
let alarmEmbed = new EmbedBuilder()
|
||||
@@ -120,7 +120,7 @@ module.exports = {
|
||||
|
||||
channel.send({ content: `<@&${alarm.role}>`, embeds: [alarmEmbed] });
|
||||
|
||||
HandlePlayerBan(client, data.killer, true);
|
||||
BanPlayer(client, data.killer);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+12
-1
@@ -62,5 +62,16 @@ module.exports = {
|
||||
}
|
||||
sendList();
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
Allows more explicit function names outside this file;
|
||||
i.e BanPlayer() & UnbanPlayer() that both call to the
|
||||
parent function HandlePlayerBan() rather than write
|
||||
two whole different functions for each.
|
||||
*/
|
||||
|
||||
BanPlayer: async (client, gamertag) => module.exports.HandlePlayerBan(client, gamertag, true),
|
||||
UnbanPlayer: async (client, gamertag) => module.exports.HandlePlayerBan(client, gamertag, false),
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user