mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Transitioned all Misc, audio, Selmer Specific, admin, anime/manga, and inventory commands to Slash Command format. The RSS and reactionrole commands are still broken and all game commands are still in message format due to compications
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
|
||||
/**
|
||||
* Check if the user has a premium subscription
|
||||
* @param {*} bot
|
||||
* @param {String} userId
|
||||
* @returns {Promise<Boolean>}
|
||||
*/
|
||||
function verPremium(bot, userId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const member = bot.guilds.cache.get(bot.home_server).members.cache.get(userId);
|
||||
bot.mongoconnection.then(async (client) => {
|
||||
const dbo = client.db('main').collection('authorized');
|
||||
dbo.findOne({ discordID: userId }).then((doc) => {
|
||||
//Only available to Selmer Bot devs, testers and "authorized" users
|
||||
if (doc != undefined || member && (member.roles.cache.has('944048889038774302') || member.roles.cache.has('946610800418762792'))) {
|
||||
resolve(true);
|
||||
} else {
|
||||
reject("You have to be a premium subscriber to use this feature!\n_support coming soon_");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
module.exports = { verPremium }
|
||||
Reference in New Issue
Block a user