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"];
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}${config.invite.otherParams || ""}`);
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=${config.invite.redirectUri}${config.invite.otherParams || ""}`);
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) {
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 = {};
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) {
if (!canUseList[category.categoryId]) canUseList[category.categoryId] = {};

View file

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