This commit is contained in:
Jonny_Bro (Nikita) 2023-07-02 01:14:35 +05:00
parent 8416a3f661
commit 889f9fc954
3 changed files with 41 additions and 42 deletions

View file

@ -46,10 +46,10 @@ module.exports = (app, config, themeConfig, modules) => {
const scopes = config.invite.scopes || ["bot"]; const scopes = config.invite.scopes || ["bot"];
if (req.query.redirect && !req.query.g) if (req.query.redirect && !req.query.g) // TODO: Fix req.query.redirect
return res.redirect(`https://discord.com/oauth2/authorize?client_id=${config.invite.clientId || config.bot.user.id}&scope=${scopes.join("%20")}&permissions=${config.invite.permissions || "0"}&response_type=code&redirect_uri=${req.query.redirect}${config.invite.otherParams || ""}`); return res.redirect(`https://discord.com/oauth2/authorize?client_id=${config.invite.clientId || config.bot.user.id}&scope=${scopes.join("%20")}&permissions=${config.invite.permissions || "0"}&response_type=code&redirect_uri=${config.invite.redirectUri}${config.invite.otherParams || ""}`);
if (req.query.redirect && req.query.g) if (req.query.redirect && req.query.g)
return res.redirect(`https://discord.com/oauth2/authorize?client_id=${config.invite.clientId || config.bot.user.id}&scope=${scopes.join("%20")}&permissions=${config.invite.permissions || "0"}&response_type=code&redirect_uri=${req.query.redirect}&guild_id=${req.query.g}${config.invite.otherParams || ""}`); return res.redirect(`https://discord.com/oauth2/authorize?client_id=${config.invite.clientId || config.bot.user.id}&scope=${scopes.join("%20")}&permissions=${config.invite.permissions || "0"}&response_type=code&redirect_uri=${config.invite.redirectUri}&guild_id=${req.query.g}${config.invite.otherParams || ""}`);
if (req.query.g) { if (req.query.g) {
let thingymabob = config.invite.redirectUri ? `&response_type=code&redirect_uri=${config.invite.redirectUri}` : null; let thingymabob = config.invite.redirectUri ? `&response_type=code&redirect_uri=${config.invite.redirectUri}` : null;

View file

@ -38,7 +38,8 @@ module.exports = function (config, themeConfig) {
const canUseList = {}; const canUseList = {};
if (config.settings?.length) { if (config.settings?.length) {
config.settings = config.settings.filter(c => c.categoryPermissions ? bot.guilds.cache.get(req.params.id).members.cache.get(req.session.user.id).permissions.has(c.categoryPermissions) : true); bot.guilds.cache.get(req.params.id).members.fetch(req.session.user.id);
config.settings = config.settings.filter(c => c.categoryPermissions ? bot.guilds.cache.get(req.params.id).members.cache.get(req.session.user.id).permissions.has(c.categoryPermissions, true) : true);
for (const category of config.settings) { for (const category of config.settings) {
if (!canUseList[category.categoryId]) canUseList[category.categoryId] = {}; if (!canUseList[category.categoryId]) canUseList[category.categoryId] = {};

View file

@ -79,15 +79,14 @@
</a> </a>
</li> </li>
<li class="nav-item mt-3"> <li class="nav-item mt-3">
<h6 class="ps-4 ms-2 text-uppercase text-xs font-weight-bolder opacity-6">Settings <h6 class="ps-4 ms-2 text-uppercase text-xs font-weight-bolder opacity-6">Settings Categories</h6>
Categories</h6>
</li> </li>
<% settings.forEach(s=> { %> <% settings.forEach(s => { %>
<a class="<%- s.categoryId %>"> <a class="<%- s.categoryId %>">
<% if(s.premium) { %> <% if(s.premium) { %>
<div class="sidebarPremium"><i style="color: var(--colone) !important;" <div class="sidebarPremium"><i style="color: var(--colone) !important;" class="fas fa-crown"></i></div>
class="fas fa-crown"></i></div>
<% } %> <% } %>
<li class="nav-item categories" id="<%- s.categoryId %>"> <li class="nav-item categories" id="<%- s.categoryId %>">
<a class="nav-link <% if (req.params.category == s.categoryId) { %>active<% } %>" <a class="nav-link <% if (req.params.category == s.categoryId) { %>active<% } %>"
id="<%- s.categoryId %>"> id="<%- s.categoryId %>">
@ -121,7 +120,6 @@
</a> </a>
</li> </li>
<% }) %> <% }) %>
</ul> </ul>
</div> </div>
<% if(themeConfig?.premium && req.session.user) { %> <% if(themeConfig?.premium && req.session.user) { %>