mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
limited test command system
This commit is contained in:
parent
00873fa78e
commit
cde456f913
4 changed files with 34 additions and 11 deletions
19
commands/message/utils/testing.js
Normal file
19
commands/message/utils/testing.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
// Get Test Config
|
||||
let LIMITED_TEST_GUILDS;
|
||||
if(process.env.TESTING_SERVER_IDS) LIMITED_TEST_GUILDS = process.env.TESTING_SERVER_IDS.split(';')
|
||||
let LIMITED_TEST_CHANNELS;
|
||||
if(process.env.TESTING_CHANNEL_IDS) LIMITED_TEST_CHANNELS = process.env.TESTING_CHANNEL_IDS.split(';')
|
||||
let LIMITED_TEST_USERS;
|
||||
if(process.env.TESTING_USER_IDS) LIMITED_TEST_USERS = process.env.TESTING_USER_IDS.split(';')
|
||||
|
||||
function canUseLimitedTestCommands(context){
|
||||
if(LIMITED_TEST_GUILDS && LIMITED_TEST_GUILDS.includes(context.guild.id)) return true;
|
||||
if(LIMITED_TEST_CHANNELS && LIMITED_TEST_CHANNELS.includes(context.channel.id)) return true;
|
||||
if(LIMITED_TEST_USERS && LIMITED_TEST_USERS.includes(context.user.id)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
canUseLimitedTestCommands
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue