Solved ( I hope)
This commit is contained in:
1 parent
7828bc3d26
commit
636cbf8c02
4 files changed
+26
-14
No files matched your search
@@ -3,7 +3,7 @@ var express = require('express'),
|
||||
passport = require('passport');
|
||||
const request = require('request');
|
||||
var url = require('url');
|
||||
|
||||
var users = require('../../../models/user.js');
|
||||
const client = require('../../../index');
|
||||
router.get("/", (req, res, next) => {
|
||||
if (req.session.backURL) {
|
||||
@@ -45,6 +45,19 @@ router.get('/callback', passport.authenticate('discord', {
|
||||
.setFooter({ text: 'Logged in', iconURL: "https://cdn.discordapp.com/avatars/" + req.user.id + "/" + req.user.avatar + ".png" });
|
||||
client.client.channels.cache.get(client.client.config.bot.channels.login).send({ embeds: [embed] });
|
||||
res.redirect(req.session.backURL || '/')
|
||||
users.findOne({ id: req.user.id }, (err, user) => {
|
||||
if (err) return console.log(err);
|
||||
if (!user) {
|
||||
var newUser = new users({
|
||||
id: req.user.id,
|
||||
username: req.user.username,
|
||||
discriminator: req.user.discriminator,
|
||||
avatar: req.user.avatar,
|
||||
coins: 0
|
||||
});
|
||||
newUser.save();
|
||||
}
|
||||
});
|
||||
});
|
||||
router.get('/logout', function (req, res) {
|
||||
req.logout(function (err) {
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
<div class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { if (i===5) break; var bot=nbots[i]; if(bot) { %>
|
||||
<% var serverr = global.bsl.guilds.cache.get(bot.id); if(serverr) { %>
|
||||
<% var serverr = global.bsl.guilds.cache.get(bot.id); if(serverr) { %>
|
||||
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color " onclick="location.href='/server/<%=bot.id%> ';" style="cursor: pointer;">
|
||||
<img class="w-full rounded-full" src="https://cdn.discordapp.com/icons/<%= bot.id %>/<%= serverr.icon %>.webp" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
|
||||
<div class="px-6 text-white text-base">
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
<div class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { var bot=nbots[i]; if(bot) { %>
|
||||
<% getBot = global.bsl.guilds.cache.get(bot.id); %>
|
||||
|
||||
<% var getBot = global.bsl.guilds.cache.get(bot.id); %>
|
||||
<% if(getBot) {%>
|
||||
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color " onclick="location.href='/server/<%=bot.id%> ';" style="cursor: pointer;">
|
||||
<img class="w-full rounded-full" src="<%= getBot.iconURL({ format: 'png' }) %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
|
||||
<img class="w-full rounded-full" src="https://cdn.discordapp.com/icons/<%= bot.id %>/<%= getBot.icon %>.webp" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
|
||||
<div class="px-6 text-white text-base">
|
||||
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <i class="fa fa-user"></i>: <%= global.bsl.guilds.cache.get(bot.id).memberCount.toLocaleString().replace(',', '.' ) %><span class="float-right"><i class="fa fa-bomb"></i>: <%=bot.bumps %></span>
|
||||
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <i class="fa fa-user"></i>: <%= getBot.memberCount.toLocaleString().replace(',', '.' ) %><span class="float-right"><i class="fa fa-bomb"></i>: <%=bot.bumps %></span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
@@ -42,7 +42,7 @@
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% } } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="randombots">
|
||||
@@ -62,11 +62,12 @@
|
||||
<div class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { var bot=nbots[i]; if(bot) { %>
|
||||
<% getBot = global.bsl.guilds.cache.get(bot.id); %>
|
||||
<% var getBot = global.bsl.guilds.cache.get(bot.id); %>
|
||||
<% if(getBot) { %>
|
||||
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color " onclick="location.href='/server/<%=bot.id%> ';" style="cursor: pointer;">
|
||||
<img class="w-full rounded-full" src="<%= getBot.iconURL({ format: 'png' }) %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
|
||||
<img class="w-full rounded-full" src="https://cdn.discordapp.com/icons/<%= bot.id %>/<%= getBot.icon %>.webp" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
|
||||
<div class="px-6 text-white text-base">
|
||||
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <i class="fa fa-user"></i>: <%= global.bsl.guilds.cache.get(bot.id).memberCount.toLocaleString().replace(',', '.' ) %><span class="float-right"><i class="fa fa-bomb"></i>: <%=bot.bumps %></span>
|
||||
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <i class="fa fa-user"></i>: <%= getBot.memberCount.toLocaleString().replace(',', '.' ) %><span class="float-right"><i class="fa fa-bomb"></i>: <%=bot.bumps %></span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
@@ -86,7 +87,7 @@
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } } %>
|
||||
<% } } } %>
|
||||
</div>
|
||||
</div>
|
||||
<%- include('./includes/footer.ejs') %>
|
||||
@@ -4,9 +4,7 @@
|
||||
<div class="p-10 bg-blue-color w-full text-white h-full m-4 lg:mx-14 text-ellipsis lg:w-2/3">
|
||||
<p class="text-white text-clip">
|
||||
<pre style="white-space: pre-wrap;" class="text-clip break-wordsw-full h-full"><br>
|
||||
<% if(!users.biography){ %>
|
||||
User Has No biography
|
||||
<% } else if(typeof users.biography != 'undefined') { %>
|
||||
<% if(typeof users.biography != 'undefined') { %>
|
||||
<%= users.biography %>
|
||||
<% } else { %>
|
||||
User Has No biography
|
||||
|
||||
Reference in new issue
Block a user