mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-28 07:51:26 +00:00
Added function to check perms(web)
This commit is contained in:
parent
7712d9f954
commit
6588aaf41f
2 changed files with 9 additions and 2 deletions
|
@ -18,7 +18,7 @@
|
|||
"comma-dangle": ["off"],
|
||||
"import/extensions": 0,
|
||||
"guard-for-in": ["warn"],
|
||||
"no-restricted-syntax": ["warn"],
|
||||
"no-restricted-syntax": ["off"],
|
||||
"object-curly-spacing": ["off"],
|
||||
"padded-blocks": ["off"],
|
||||
"no-underscore-dangle": [
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// import Discord from "discord.js";
|
||||
import Discord from "discord.js";
|
||||
import express from "express";
|
||||
import session from "express-session";
|
||||
import passport from "passport";
|
||||
|
@ -34,6 +34,13 @@ function checkAuth(req, res, next) {
|
|||
if (req.isAuthenticated()) return next();
|
||||
res.send("not logged in :(");
|
||||
}
|
||||
// Returns all the guilds a user can control
|
||||
function canControlGuilds(guilds) {
|
||||
return guilds.filter(g => {
|
||||
gp = new Discord.Permissions(null, g.permissions);
|
||||
return gp.has("MANAGE_GUILD");
|
||||
});
|
||||
}
|
||||
// Lets get some sessions going!
|
||||
app.use(
|
||||
session({
|
||||
|
|
Loading…
Add table
Reference in a new issue