added search + solved icon
This commit is contained in:
1 parent
d91ebbfa25
commit
b8d67d588c
17 files changed
+290
-159
No files matched your search
@@ -39,8 +39,6 @@ module.exports = {
|
||||
"company",
|
||||
"game",
|
||||
"emoji",
|
||||
"botlist",
|
||||
"serverlist",
|
||||
"turkish",
|
||||
"support",
|
||||
"sound",
|
||||
@@ -50,7 +48,7 @@ module.exports = {
|
||||
]
|
||||
},
|
||||
users: {
|
||||
owner: [""],
|
||||
verificator: [""],
|
||||
owner: ["755297485328482356"],
|
||||
verificator: ["755297485328482356"],
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -3,14 +3,13 @@ let hm = new mongoose.Schema({
|
||||
id: String,
|
||||
name: String,
|
||||
description: {
|
||||
type: String, maxLength: 20
|
||||
type: String, maxLength: 100
|
||||
},
|
||||
owner: String,
|
||||
long_description: String,
|
||||
tags: [String],
|
||||
premium: Boolean,
|
||||
icon: String,
|
||||
members: Number,
|
||||
invite: String,
|
||||
votes: Number,
|
||||
bump: Date,
|
||||
webhook: String,
|
||||
|
||||
+25
-1
@@ -120,16 +120,40 @@ app.get('/bots', async (req, res) => {
|
||||
botscord: client
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/servers', async (req, res) => {
|
||||
var servers = await server.find({});
|
||||
res.render('servers', {
|
||||
servers: servers,
|
||||
user: req.user,
|
||||
botscord: client
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/tag/:id', async (req, res) => {
|
||||
var id = req.params.id;
|
||||
var bot = await bots.find({ tags: id });
|
||||
res.render('tags/index', {
|
||||
bot: bot,
|
||||
user: req.user,
|
||||
tag: id,
|
||||
});
|
||||
});
|
||||
|
||||
app.get("/robots.txt", function (req, res) {
|
||||
res.set('Content-Type', 'text/plain');
|
||||
res.send(`Sitemap: https://botscord.xyz/sitemap.xml`);
|
||||
});
|
||||
app.get("/sitemap.xml", async function (req, res) {
|
||||
let link = "<url><loc>https://botscord.xyz/</loc></url>";
|
||||
let botdataforxml = await bots.find()
|
||||
let botdataforxml = await bots.find({verified:true})
|
||||
let serverdataforxml = await server.find()
|
||||
botdataforxml.forEach(bot => {
|
||||
link += "\n<url><loc>https://botscord.xyz/bot/" + bot.id + "</loc></url>";
|
||||
})
|
||||
serverdataforxml.forEach(server => {
|
||||
link += "\n<url><loc>https://botscord.xyz/server/" + server.id + "</loc></url>";
|
||||
});
|
||||
res.set('Content-Type', 'text/xml');
|
||||
res.send(`<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="https://www.google.com/schemas/sitemap-image/1.1">${link}</urlset>`);
|
||||
});
|
||||
|
||||
@@ -874,6 +874,9 @@ video {
|
||||
.w-16 {
|
||||
width: 4rem;
|
||||
}
|
||||
.w-0 {
|
||||
width: 0px;
|
||||
}
|
||||
.w-3\/6 {
|
||||
width: 50%;
|
||||
}
|
||||
@@ -883,8 +886,10 @@ video {
|
||||
.w-1\/4 {
|
||||
width: 25%;
|
||||
}
|
||||
.w-0 {
|
||||
width: 0px;
|
||||
.min-w-fit {
|
||||
min-width: -webkit-fit-content;
|
||||
min-width: -moz-fit-content;
|
||||
min-width: fit-content;
|
||||
}
|
||||
.max-w-7xl {
|
||||
max-width: 80rem;
|
||||
@@ -898,6 +903,11 @@ video {
|
||||
.max-w-full {
|
||||
max-width: 100%;
|
||||
}
|
||||
.max-w-fit {
|
||||
max-width: -webkit-fit-content;
|
||||
max-width: -moz-fit-content;
|
||||
max-width: fit-content;
|
||||
}
|
||||
.flex-initial {
|
||||
flex: 0 1 auto;
|
||||
}
|
||||
@@ -925,6 +935,9 @@ video {
|
||||
.basis-1 {
|
||||
flex-basis: 0.25rem;
|
||||
}
|
||||
.table-auto {
|
||||
table-layout: auto;
|
||||
}
|
||||
.border-collapse {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
@@ -1097,6 +1110,9 @@ video {
|
||||
.overflow-hidden {
|
||||
overflow: hidden;
|
||||
}
|
||||
.overflow-x-auto {
|
||||
overflow-x: auto;
|
||||
}
|
||||
.text-ellipsis {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
@@ -1203,6 +1219,10 @@ video {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(229 231 235 / var(--tw-border-opacity));
|
||||
}
|
||||
.border-slate-500 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(100 116 139 / var(--tw-border-opacity));
|
||||
}
|
||||
.bg-transparent {
|
||||
background-color: transparent;
|
||||
}
|
||||
@@ -1322,12 +1342,12 @@ video {
|
||||
.p-8 {
|
||||
padding: 2rem;
|
||||
}
|
||||
.p-2\.5 {
|
||||
padding: 0.625rem;
|
||||
}
|
||||
.p-96 {
|
||||
padding: 24rem;
|
||||
}
|
||||
.p-2\.5 {
|
||||
padding: 0.625rem;
|
||||
}
|
||||
.px-3 {
|
||||
padding-left: 0.75rem;
|
||||
padding-right: 0.75rem;
|
||||
@@ -1790,6 +1810,10 @@ body {
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.hover\:bg-primary-color:hover {
|
||||
background-color: #1E2023;;
|
||||
}
|
||||
|
||||
.hover\:bg-button-primary:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(88 101 242 / var(--tw-bg-opacity));
|
||||
@@ -1805,6 +1829,16 @@ body {
|
||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.hover\:bg-gray-100:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.hover\:text-white:hover {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.hover\:text-blue-600:hover {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(37 99 235 / var(--tw-text-opacity));
|
||||
@@ -1815,11 +1849,6 @@ body {
|
||||
color: rgb(17 24 39 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.hover\:text-white:hover {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.hover\:text-blue-color:hover {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(24 25 28 / var(--tw-text-opacity));
|
||||
@@ -1984,6 +2013,11 @@ body {
|
||||
background-color: rgb(29 78 216 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.dark\:hover\:bg-gray-800:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.dark\:hover\:text-white:hover {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||
@@ -1999,16 +2033,16 @@ body {
|
||||
--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity));
|
||||
}
|
||||
|
||||
.dark\:focus\:ring-blue-800:focus {
|
||||
--tw-ring-opacity: 1;
|
||||
--tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity));
|
||||
}
|
||||
|
||||
.dark\:focus\:ring-button-primary:focus {
|
||||
--tw-ring-opacity: 1;
|
||||
--tw-ring-color: rgb(88 101 242 / var(--tw-ring-opacity));
|
||||
}
|
||||
|
||||
.dark\:focus\:ring-blue-800:focus {
|
||||
--tw-ring-opacity: 1;
|
||||
--tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity));
|
||||
}
|
||||
|
||||
.dark\:focus\:ring-gray-500:focus {
|
||||
--tw-ring-opacity: 1;
|
||||
--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity));
|
||||
|
||||
@@ -6,7 +6,7 @@ var servers = require('../../../models/server');
|
||||
var bans = require('../../../models/site-ban');
|
||||
router.get('/', async function (req, res) {
|
||||
if (req.user) {
|
||||
if (config.users.verificator.includes(req.user.userid) || config.users.owner.includes(req.user.userid)) {
|
||||
if (global.config.users.verificator.includes(req.user.id) || global.config.users.owner.includes(req.user.id)) {
|
||||
const bot = await bots.find({});
|
||||
const server = await servers.find({});
|
||||
const ban = await bans.find({});
|
||||
@@ -25,4 +25,21 @@ router.get('/', async function (req, res) {
|
||||
}
|
||||
})
|
||||
|
||||
router.get('/bot/:d', async function (req, res) {
|
||||
if (req.user) {
|
||||
if (global.config.users.verificator.includes(req.user.id) || global.config.users.owner.includes(req.user.id)) {
|
||||
const bot = await bots.find({ id: req.params.d });
|
||||
res.render('admin/bot', {
|
||||
user: req.user,
|
||||
bots: bot
|
||||
});
|
||||
} else {
|
||||
res.redirect('/');
|
||||
}
|
||||
} else {
|
||||
req.session.backURL = req.originalUrl;
|
||||
res.redirect('/auth');
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
@@ -10,17 +10,30 @@ router.get('/', function (req, res) {
|
||||
})
|
||||
});
|
||||
router.get('/search/:id', function (req, res) {
|
||||
bots.findOne({ id: req.params.id }, function (err, bot) {
|
||||
bots.find({ $or: [{ id: { $regex: req.params.id } }, { name: { $regex: req.params.id } }] },async function (err, bot) {
|
||||
if (err) throw err;
|
||||
if (!bot) {
|
||||
servers.find()
|
||||
return res.json({
|
||||
message: "Bot not found"
|
||||
return
|
||||
} else {
|
||||
var serverArray = [];
|
||||
const serverr = await servers.find({ $or: [{ id: { $regex: req.params.id } }, { name: { $regex: req.params.id } }] })
|
||||
if (!serverr) {
|
||||
return
|
||||
} else {
|
||||
serverr.forEach(function (server1) {
|
||||
serverArray.push({ "name": server1.name, "id": server1.id, "description": server1.description, type: "server", "avatar": global.bsl.guilds.cache.get(server1.id).iconURL() })
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
bot.forEach(function (server) {
|
||||
serverArray.push({ "name": server.name, "id": server.id, "description": server.description, type: "bot" });
|
||||
});
|
||||
res.json({
|
||||
serverArray
|
||||
})
|
||||
|
||||
}
|
||||
res.json({
|
||||
bot: bot,
|
||||
})
|
||||
})
|
||||
})
|
||||
router.use(function (req, res, next) {
|
||||
|
||||
@@ -80,6 +80,7 @@ router.get('/:botID', async function (req, res) {
|
||||
let coowner = new Array()
|
||||
await bot.owners.forEach(async function (a) {
|
||||
var b = await global.bsl.users.fetch(a)
|
||||
if(!b) return;
|
||||
coowner.push(b)
|
||||
})
|
||||
try {
|
||||
|
||||
@@ -211,9 +211,9 @@ router.get('/:server/vote', function (req, res) {
|
||||
return res.redirect('/');
|
||||
}
|
||||
if (bot.votes) {
|
||||
bot.votes = 1;
|
||||
} else {
|
||||
bot.votes++;
|
||||
} else {
|
||||
bot.votes = 1;
|
||||
}
|
||||
bot.save(function (err) {
|
||||
if (err) {
|
||||
@@ -234,6 +234,14 @@ router.get('/:server/vote', function (req, res) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setTitle(`${req.user.username} has voted for ${bot.name}`)
|
||||
.setDescription(`[${bot.name}](${bot.url})`)
|
||||
.setThumbnail(global.bsl.guilds.cache.get(bot.id).iconURL({ format: 'png' }))
|
||||
.setFooter({ text: "BotsCord", iconURL: "https://botscord.xyz/img/logo.png"})
|
||||
.setTimestamp();
|
||||
global.client.channels.cache.get(global.config.bot.channels.vote).send({ embeds: [embed] });
|
||||
req.session.message = "Vote added";
|
||||
return res.redirect('/');
|
||||
})
|
||||
@@ -251,9 +259,9 @@ router.get('/:server/vote', function (req, res) {
|
||||
return res.redirect('/');
|
||||
} else {
|
||||
if (bot.votes) {
|
||||
bot.votes = 1;
|
||||
} else {
|
||||
bot.votes++;
|
||||
} else {
|
||||
bot.votes = 1;
|
||||
}
|
||||
bot.save(function (err) {
|
||||
if (err) {
|
||||
@@ -273,6 +281,14 @@ router.get('/:server/vote', function (req, res) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setTitle(`${req.user.username} has voted for ${bot.name}`)
|
||||
.setDescription(`[${bot.name}](${bot.url})`)
|
||||
.setThumbnail(global.bsl.guilds.cache.get(bot.id).iconURL({ format: 'png' }))
|
||||
.setFooter({ text: "BotsCord", iconURL: "https://botscord.xyz/img/logo.png" })
|
||||
.setTimestamp();
|
||||
global.client.channels.cache.get(global.config.bot.channels.vote).send({ embeds: [embed] });
|
||||
req.session.message = "Vote added";
|
||||
return res.redirect('/');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<%- include("../includes/header.ejs", { title: "Bot" + bots.name}) %>
|
||||
<div class="overflow-x-auto relative container-sm">
|
||||
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
|
||||
<tr>
|
||||
<th scope="col" class="py-3 px-6">
|
||||
Bot Name
|
||||
</th>
|
||||
<th scope="col" class="py-3 px-6">
|
||||
BotID
|
||||
</th>
|
||||
<th scope="col" class="py-3 px-6">
|
||||
Bot Description
|
||||
</th>
|
||||
<th scope="col" class="py-3 px-6">
|
||||
Owner
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% var nbots = bots.filter(bot => bot.verified == false); %>
|
||||
<% nbots.forEach(function(bot) { %>
|
||||
<tr class="hover:bg-gray-100 dark:hover:bg-gray-800" onclick="location.href='/admin/bot/<%= bot.id %>'">
|
||||
<td class="py-3 px-6">
|
||||
<%= bot.name %>
|
||||
</td>
|
||||
<td class="py-3 px-6">
|
||||
<%= bot.id %>
|
||||
</td>
|
||||
<td class="py-3 px-6">
|
||||
<%= bot.description %>
|
||||
</td>
|
||||
<td class="py-3 px-6">
|
||||
<%= bot.owner %>
|
||||
</td>
|
||||
</tr>
|
||||
<% }) %>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,41 @@
|
||||
<%- include("../includes/header.ejs", {title: "Admin"}) %>
|
||||
<div class="overflow-x-auto relative">
|
||||
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
|
||||
<tr>
|
||||
<th scope="col" class="py-3 px-6">
|
||||
Bot Name
|
||||
</th>
|
||||
<th scope="col" class="py-3 px-6">
|
||||
BotID
|
||||
</th>
|
||||
<th scope="col" class="py-3 px-6">
|
||||
Bot Description
|
||||
</th>
|
||||
<th scope="col" class="py-3 px-6">
|
||||
Owner
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% var nbots = bots.filter(bot => bot.verified == false); %>
|
||||
<% nbots.forEach(function(bot) { %>
|
||||
<tr class="hover:bg-gray-100 dark:hover:bg-gray-800" onclick="location.href='/admin/bot/<%= bot.id %>'">
|
||||
<td class="py-3 px-6">
|
||||
<%= bot.name %>
|
||||
</td>
|
||||
<td class="py-3 px-6">
|
||||
<%= bot.id %>
|
||||
</td>
|
||||
<td class="py-3 px-6">
|
||||
<%= bot.description %>
|
||||
</td>
|
||||
<td class="py-3 px-6">
|
||||
<%= bot.owner %>
|
||||
</td>
|
||||
</tr>
|
||||
<% }) %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Whitespace-only changes.
+27
-99
@@ -1,12 +1,12 @@
|
||||
<%- include("./includes/header.ejs") %>
|
||||
<div class="promotedbots">
|
||||
<% var nbots=bots.filter(a=> a.promoted == true)
|
||||
nbots.forEach((val, key) => {
|
||||
randomIndex = Math.ceil(Math.random()*(key + 1));
|
||||
nbots[key] = nbots[randomIndex];
|
||||
nbots[randomIndex] = val;
|
||||
});
|
||||
if(nbots.length > 0) { %>
|
||||
nbots.forEach((val, key) => {
|
||||
randomIndex = Math.ceil(Math.random()*(key + 1));
|
||||
nbots[key] = nbots[randomIndex];
|
||||
nbots[randomIndex] = val;
|
||||
});
|
||||
if(nbots.length > 0) { %>
|
||||
<div class="mx-auto text-center">
|
||||
<br>
|
||||
<h2 class="text-xl text-white text-center"><i class="fa fa-bullhorn" aria-hidden="true"></i> Promoted Bots
|
||||
@@ -16,12 +16,10 @@
|
||||
<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===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
|
||||
<img class="w-full rounded-full" src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp" alt="<%= bot.name %>">
|
||||
<div class="px-6 py-4 text-white text-base">
|
||||
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %>
|
||||
<%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %>
|
||||
<% } %>
|
||||
<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='/bot/<%=bot.id%> ';" style="cursor: pointer;">
|
||||
<img class="w-full rounded-full" src="<%= global.bsl.users.cache.get(bot.id).user.displayAvatarURL() %>" 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 %> <%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %><% } %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
@@ -32,19 +30,10 @@
|
||||
<%= bot.description %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<a href="/bot/<%= bot.id %>" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i> View
|
||||
</a>
|
||||
<a href="/bot/<%= bot.id %>/invite" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-link" aria-hidden="true"></i> Invite
|
||||
</a>
|
||||
</div>
|
||||
<% if(bot.tags) {%>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<% bot.tags.forEach(tag=>{ %>
|
||||
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
|
||||
<%= tag %>
|
||||
<% bot.tags.slice(-3).forEach(tag=>{ %>
|
||||
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
@@ -56,12 +45,12 @@
|
||||
</div>
|
||||
<div class="randombots">
|
||||
<% var nbots=bots.filter(a=> a.verified == true)
|
||||
nbots.forEach((val, key) => {
|
||||
randomIndex = Math.ceil(Math.random()*(key + 1));
|
||||
nbots[key] = nbots[randomIndex];
|
||||
nbots[randomIndex] = val;
|
||||
});
|
||||
if(nbots.length > 0) { %>
|
||||
nbots.forEach((val, key) => {
|
||||
randomIndex = Math.ceil(Math.random()*(key + 1));
|
||||
nbots[key] = nbots[randomIndex];
|
||||
nbots[randomIndex] = val;
|
||||
});
|
||||
if(nbots.length > 0) { %>
|
||||
<div class="mx-auto text-center">
|
||||
<br>
|
||||
<h2 class="text-xl text-white text-center"><i class="fa fa-shuffle" aria-hidden="true"></i> Random Bots
|
||||
@@ -71,86 +60,25 @@
|
||||
<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===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
|
||||
<img class="w-full rounded-full" src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp" alt="<%= bot.name %>">
|
||||
<div class="px-6 py-4 text-white text-base">
|
||||
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %><% } %></p>
|
||||
<% getBot = global.bsl.users.cache.get(bot.id); %>
|
||||
<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='/bot/<%=bot.id%> ';" style="cursor: pointer;">
|
||||
<img class="w-full rounded-full" src="<%= "https://cdn.discordapp.com/avatars/" + bot.id + "/" + getBot?.avatar +".png" %>" 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 %> <%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %><% } %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
<div class="font-bold text-xl mb-2 text-white">
|
||||
<%= bot.name %>
|
||||
<%= getBot.username %>
|
||||
</div>
|
||||
<p class="text-white text-base">
|
||||
<%= bot.description %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<a href="/bot/<%= bot.id %>" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i> View
|
||||
</a>
|
||||
<a href="/bot/<%= bot.id %>/invite" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-link" aria-hidden="true"></i> Invite
|
||||
</a>
|
||||
</div>
|
||||
<% if(bot.tags) {%>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<% bot.tags.forEach(tag=>{ %>
|
||||
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
|
||||
<%= tag %>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="randombots">
|
||||
<% var nbots=bots.filter(a=> a.verified == true)
|
||||
nbots.forEach((val, key) => {
|
||||
randomIndex = Math.ceil(Math.random()*(key + 1));
|
||||
nbots[key] = nbots[randomIndex];
|
||||
nbots[randomIndex] = val;
|
||||
});
|
||||
if(nbots.length > 0) { %>
|
||||
<div class="mx-auto text-center">
|
||||
<br>
|
||||
<h2 class="text-xl text-white text-center"><i class="fa fa-check-to-slot" aria-hidden="true"></i> Best bots
|
||||
</h2>
|
||||
<p class="content text-white text-center" style="opacity:.6">Bots with highest votes!</p>
|
||||
</div>
|
||||
<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===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
|
||||
<img class="w-full rounded-full" src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp" alt="<%= bot.name %>">
|
||||
<div class="px-6 py-4 text-white text-base">
|
||||
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %>
|
||||
<%if(bot.servers) { %><i class="fa fa-server"></i>: <%= bot.servers %>
|
||||
<% } %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
<div class="font-bold text-xl mb-2 text-white">
|
||||
<%= bot.name %>
|
||||
</div>
|
||||
<p class="text-white text-base">
|
||||
<%= bot.description %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<a href="/bot/<%= bot.id %>" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i> View
|
||||
</a>
|
||||
<a href="/bot/<%= bot.id %>/invite" class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-link" aria-hidden="true"></i> Invite
|
||||
</a>
|
||||
</div>
|
||||
<% if(bot.tags) {%>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<% bot.tags.forEach(tag=>{ %>
|
||||
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
|
||||
<%= tag %>
|
||||
<% bot.tags.slice(-3).forEach(tag=>{ %>
|
||||
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<meta property="og:image" content="<%= server.icon %>" />
|
||||
<meta property="og:description" content="<%= server.description %>
|
||||
|
||||
🟢 <%= global.bsl.guilds.cache.get(server.id).members.cache.filter(a => a.presence?.status != 'dnd').size %> onlineᅠᅠᅠᅠ⚫ <%= global.bsl.guilds.cache.get(server.id).memberCount %> members">
|
||||
🟢 <%= global.bsl.guilds.cache.get(server.id).members.cache.filter(a => a.presence?.status).size %> onlineᅠᅠᅠᅠ⚫ <%= global.bsl.guilds.cache.get(server.id).memberCount %> members">
|
||||
<% } %>
|
||||
<meta property="og:title" content="BotsCord.xyz" />
|
||||
<meta property="og:type" content="website" />
|
||||
|
||||
+40
-14
@@ -18,14 +18,44 @@
|
||||
</svg>
|
||||
</div>
|
||||
<input type="text" id="simple-search" class="bg-primary-color border border-gray-300 text-white text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5 dark:bg-primary-color dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Search" required>
|
||||
|
||||
<div id="search-results" class="hidden bg-primary-color border border-gray-300 text-white text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full pl-10 p-2.5 dark:bg-primary-color dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"></div>
|
||||
</div>
|
||||
<button type="submit" class="p-2.5 ml-2 text-sm font-medium text-white bg-button-primary rounded-lg border border-button-primary hover:bg-button-primary focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-button-primary dark:hover:bg-button-primary dark:focus:ring-blue-800" style="max-width:80%">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
||||
</svg>
|
||||
<span class="sr-only">Search</span>
|
||||
</button>
|
||||
</form>
|
||||
</form><br>
|
||||
<script>
|
||||
var search = document.getElementById('simple-search');
|
||||
search.addEventListener("keyup", function(e) {
|
||||
if (!search.value) {
|
||||
document.getElementById('search-results').innerHTML = "";
|
||||
document.getElementById('search-results').classList.add('hidden');
|
||||
return;
|
||||
} else {
|
||||
$.ajax({
|
||||
url: '/api/v1/search/' + search.value,
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
var html = '';
|
||||
for (var i = 0; i < data.serverArray.length; i++) {
|
||||
if (i == 5) {
|
||||
break;
|
||||
}
|
||||
if (data.serverArray[i].type == 'server') {
|
||||
html += '<a href="/server/' + data.serverArray[i].id + '" class="flex items-center p-2 border-b border-gray-300 hover:bg-primary-color hover:text-white"><img title="botscord.site" class="mr-2" width="48" onError="this.src = ' + "'/img/logo.webp'" + '" style="border-radius: 8px;" src="' + data.serverArray[i].avatar + '" />' + data.serverArray[i].name + '</a>';
|
||||
} else {
|
||||
html += '<a href="/bot/' + data.serverArray[i].id + '" class="flex items-center p-2 border-b border-gray-300 hover:bg-primary-color hover:text-white"><img title="botscord.site" class="mr-2" width="48" onError="this.src = ' + " '/img/logo.webp'" + '" style="border-radius: 8px;" src="' + data.serverArray[i].avatar + '" />' + data.serverArray[i].name + '</a>';
|
||||
}
|
||||
}
|
||||
var searchr = document.getElementById('search-results');
|
||||
if (searchr.classList.contains("hidden")) {
|
||||
searchr.classList.remove("hidden");
|
||||
}
|
||||
document.getElementById('search-results').innerHTML = html;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<a title="BotsCord" href="/tag/Moderation" class="text-white bg-button-primary hover:bg-button-primary focus:ring-4 focus:ring-blue-300 font-bold rounded-lg text-sm px-2 py-2 mb-2 dark:bg-button-primary dark:hover:bg-button-primary focus:outline-none dark:focus:ring-button-primary underline hover:no-underline"><i class="fa fa-magic"></i> Moderation</a>
|
||||
<a title="BotsCord" href="/tag/Fun" class="text-white bg-button-primary hover:bg-button-primary focus:ring-4 focus:ring-blue-300 font-bold rounded-lg text-sm px-2 py-2 mb-2 dark:bg-button-primary dark:hover:bg-button-primary focus:outline-none dark:focus:ring-button-primary underline hover:no-underline"><i class="fa fa-smile"></i> Fun</a>
|
||||
<a title="BotsCord" href="/tag/Moderation" class="text-white bg-button-primary hover:bg-button-primary focus:ring-4 focus:ring-blue-300 font-bold rounded-lg text-sm px-2 py-2 mb-2 dark:bg-button-primary dark:hover:bg-button-primary focus:outline-none dark:focus:ring-button-primary underline hover:no-underline"><i class="fa fa-file"></i> Logging</a>
|
||||
@@ -140,7 +170,7 @@
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<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="<%= bot.icon %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
|
||||
<img class="w-full rounded-full" src="<%= global.bsl.guilds.cache.get(bot.id).iconURL({ format: 'png' }) %>" 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(',', '.' ) %>
|
||||
</p>
|
||||
@@ -185,13 +215,11 @@
|
||||
<% servers.sort((a, b) => b.bump - a.bump).slice(0, 5).map(bot => {
|
||||
if(!bot) return; %>
|
||||
<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="<%= bot.icon %> " onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
|
||||
<% if (bot.votes){ %>
|
||||
<img class="w-full rounded-full" src="<%= global.bsl.guilds.cache.get(bot.id).iconURL({ format: 'png' }) %> " 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>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="px-6 py-4">
|
||||
<div class="font-bold text-xl mb-2 text-white">
|
||||
<%= bot.name %>
|
||||
@@ -230,12 +258,10 @@
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<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="<%= bot.icon %> " onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
|
||||
<% if (bot.votes){ %>
|
||||
<img class="w-full rounded-full" src="<%= global.bsl.guilds.cache.get(bot.id).iconURL({ format: 'png' }) %> " 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>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="px-6 py-4">
|
||||
<div class="font-bold text-xl mb-2 text-white">
|
||||
<%= bot.name %>
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
<div class="relative z-0 mb-6 w-full group">
|
||||
<textarea type="text" name="server_description" id="server_name" class="block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer" placeholder=" " required rows="5"></textarea>
|
||||
<label for="server_name" class="peer-focus:font-medium absolute text-sm text-white dark:text-white duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Server
|
||||
description (MarkDown supported!)</label>
|
||||
description</label>
|
||||
</div>
|
||||
<div class="relative z-0 mb-6 w-full group">
|
||||
<input type="text" name="server_short" id="floating_last_name" class="block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer" placeholder=" " required />
|
||||
<input type="text" name="server_short" maxlength="100" id="floating_last_name" class="block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer" placeholder=" " required />
|
||||
<label for="server_name" class="peer-focus:font-medium absolute text-sm text-white dark:text-white duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Short
|
||||
Description (Will be show on home page)</label>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<div class="box-2-p"><i class="mt-1 fa fa-users"></i></div>
|
||||
<p class="box-2">Members: <%= serverr.memberCount.toLocaleString().replace(',', '.' ) %>/ <%= global.bsl.guilds.cache.get(server.id).members.cache.filter(a => a.presence?.status != 'dnd').size %> online
|
||||
<p class="box-2">Members: <%= serverr.memberCount.toLocaleString().replace(',', '.' ) %>/ <%= global.bsl.guilds.cache.get(server.id).members.cache.filter(a => a.presence?.status).size %> online
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
@@ -81,10 +81,4 @@
|
||||
</div>
|
||||
<br><br><br>
|
||||
|
||||
<%- include('../includes/footer.ejs') %>
|
||||
<!-- <% /*, meta: {
|
||||
site_name: 'Powered by Botscord',
|
||||
description: server.description + "🟢" + global.bsl.guilds.cache.get(server.id).members.cache.filter(a => a.presence.status != 'dnd').size + "online ⚫" +global.bsl.guilds.cache.get(server.id).memberCount + "members",
|
||||
image: server.icon
|
||||
} */
|
||||
%> -->
|
||||
<%- include('../includes/footer.ejs') %>
|
||||
@@ -0,0 +1 @@
|
||||
<%- include("../includes/header.ejs", { title: "Tag: " + tag}) %>
|
||||
Reference in new issue
Block a user