Added bots & votes

This commit is contained in:
CorwinDev committed 2022-08-08 21:32:55 +02:00
1 parent c058ab2e55
commit 47dfdbd344
16 files changed
+565 -224

No files matched your search

+3 -3
View File
@@ -1,8 +1,8 @@
{
"emmet.includeLanguages": {
"ejs": "html"
"ejs": "html",
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
}
"editor.defaultFormatter": "j69.ejs-beautify"
},
}
+4 -1
View File
@@ -5,11 +5,14 @@ let hm = new mongoose.Schema({
icon: String,
verified: Boolean,
description: String,
owner: String,
owners: [String],
long_description: String,
banner: String,
tags: [String],
premium: Boolean,
servers: String,
users: String,
votes: Number,
});
module.exports = mongoose.model("bots", hm);
+8
View File
@@ -0,0 +1,8 @@
const mongoose = require("mongoose");
let model = new mongoose.Schema({
user: String,
date: Date,
bot: String,
});
module.exports = mongoose.model("votes", model);
+12 -4
View File
@@ -31,7 +31,7 @@ var prompt = 'consent'
passport.use(new DiscordStrategy({
clientID: '934087523649609768',
clientSecret: 'nPKjKvOCOyyhDaQM64qcJYbd6CdhCxLh',
callbackURL: 'http://localhost:3000/auth/callback',
callbackURL: client.config.server.host + '/auth/callback',
scope: scopes,
prompt: prompt
},
@@ -110,6 +110,14 @@ app.get('/', async (req, res) => {
}
});
app.get('/bots', async (req, res) => {
var bot = await bots.find({});
res.render('bots', {
bots: bot,
user: req.user,
botscord: client
});
});
app.get("/robots.txt", function (req, res) {
res.set('Content-Type', 'text/plain');
res.send(`Sitemap: https://botscord.xyz/sitemap.xml`);
@@ -133,12 +141,12 @@ app.use((req, res, next) => {
} else if (res.statusCode === 500) {
req.session.error = "Internal server error";
res.redirect('/');
}else{
} else {
req.session.error = "Page not found";
res.redirect('/');
}
})
app.listen(port, () => {
console.log(colors.green("Website: "),'Your app is listening on port ' + port);
app.listen(client.config.server.port, () => {
console.log(colors.green("Website: "), 'Your app is listening on port ' + port);
});
module.exports.client = client;
+3 -8
View File
@@ -1061,6 +1061,9 @@ video {
.overflow-hidden {
overflow: hidden;
}
.text-ellipsis {
text-overflow: ellipsis;
}
.break-words {
overflow-wrap: break-word;
}
@@ -1966,14 +1969,6 @@ body {
display: inline;
}
.sm\:flex {
display: flex;
}
.sm\:grid {
display: grid;
}
.sm\:min-h-min {
min-height: -webkit-min-content;
min-height: -moz-min-content;
+15 -7
View File
@@ -1,19 +1,27 @@
var express = require('express');
var index = require('./../../../index');
var config = require('./../../../index').config;
var router = express.Router();
router.get('/', function (req, res) {
var bots = require('../../../models/bot');
var servers = require('../../../models/server');
var bans = require('../../../models/site-ban');
router.get('/', async function (req, res) {
if (req.user) {
if (index.config.users.verificator.includes(req.user.userid) || index.config.users.owner.includes(req.user.userid)) {
if (config.users.verificator.includes(req.user.userid) || config.users.owner.includes(req.user.userid)) {
const bot = await bots.find({});
const server = await servers.find({});
const ban = await bans.find({});
res.render('admin/index', {
title: 'Admin',
user: req.user
user: req.user,
bots: bot,
servers: server,
bans: ban
});
} else {
res.redirect('/');
}
} else {
res.redirect('/auth?r=' + req.originalUrl);
req.session.backURL = req.originalUrl;
res.redirect('/auth');
}
})
+124 -6
View File
@@ -1,12 +1,14 @@
var express = require('express'),
router = express.Router();
var bots = require('../../../models/bot');
var votes = require('../../../models/votes');
const client = require('../../index');
router.get('/', function () {
return res.redirect('/bots');
})
router.get('/add', function (req, res) {
if (req.user) {
res.render('bot/add', {user: req.user});
res.render('bot/add', { user: req.user });
return
} else {
req.session.backURL = req.originalUrl;
@@ -16,12 +18,23 @@ router.get('/add', function (req, res) {
router.post('/add', function (req, res) {
if (req.user) {
var checkbot = bots.findOne({ id: req.body.id });
if (checkbot) {
req.session.error = "Bot already exists";
res.redirect('/');
return
}
var owners = new Array();
req.body.bot_owners.split(',').forEach(function (owner) {
owners.push(owner.trim());
})
owners.push(req.user.id);
var bot = new bots({
id: req.body.bot_id,
name: req.body.bot_name,
verified: false,
long_description: req.body.bot_description,
owner: req.user.userid,
owners: owners,
description: req.body.bot_short,
tags: req.body.tags,
});
@@ -36,14 +49,14 @@ router.post('/add', function (req, res) {
res.redirect('/');
}
});
}else {
} else {
req.session.backURL = req.originalUrl;
res.redirect('/auth');
}
});
router.get('/:botID', function (req, res) {
bots.findOne({ id: req.params.botID }, function (err, bot) {
router.get('/:botID', async function (req, res) {
bots.findOne({ id: req.params.botID }, async function (err, bot) {
if (err) {
console.log(err);
return res.redirect('/');
@@ -52,8 +65,113 @@ router.get('/:botID', function (req, res) {
req.session.error = "No bot found";
return res.redirect('/');
}
let coowner = new Array()
await bot.owners.forEach(async function (a) {
var b = await global.bsl.users.fetch(a)
coowner.push(b)
})
try {
var bota = await global.bsl.users.fetch(bot.id)
} catch (e) {
if (!bota) {
req.session.error = "No bot found";
return res.redirect('/');
}
}
if (!bota) {
req.session.error = "No bot found";
return res.redirect('/');
}
res.render('bot/index', {
bot: bot });
bot: bot,
user: req.user,
owners: coowner,
bota: bota
});
})
})
router.get('/:botID/vote', async function (req, res) {
if (!req.user) {
req.session.backURL = req.originalUrl;
res.redirect('/auth');
} else {
bots.findOne({ id: req.params.botID }, async function (err, bot) {
if (err) {
console.log(err);
return res.redirect('/');
}
if (!bot) {
req.session.error = "No bot found";
return res.redirect('/');
}
// check if users has already voted for this bot
votes.findOne({ user: req.user.id, bot: bot.id }, function (err, vote) {
if (err) {
console.log(err);
return res.redirect('/');
}
if (vote) {
if (vote.date > Date.now() - (1000 * 60 * 60 * 24)) {
req.session.error = "You can only vote once per day";
return res.redirect('/');
}
vote.date = Date.now();
vote.save(function (err) {
if (err) {
console.log(err);
return res.redirect('/');
}
if (bot.votes) {
bot.votes = 1;
} else {
bot.votes++;
}
bot.save(function (err) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
return res.redirect('/');
}
})
req.session.message = "Vote added";
return res.redirect('/');
})
} else {
// add vote to database
var vote = new votes({
user: req.user.id,
date: new Date(),
bot: bot.id,
});
vote.save(function (err) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
return res.redirect('/');
} else {
if (bot.votes) {
bot.votes = 1;
} else {
bot.votes++;
}
bot.save(function (err) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
return res.redirect('/');
} else {
req.session.message = "Vote added";
return res.redirect('/');
}
})
}
});
}
})
})
}
})
module.exports = router;
+5 -2
View File
@@ -21,10 +21,13 @@
<input type="text" name="bot_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 />
<label for="bot_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>
<div class="relative z-0 mb-6 w-full group">
<input type="text" name="bot_owners" 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="bot_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">Owners (split with <strong>,</strong> ) (You are automatic included!)</label>
</div>
<!-- tags -->
<div class="relative z-0 mb-6 w-full group">
<select multiple name="tag" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required>
<select multiple name="tags" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required>
<option value="moderation">Moderation</option>
<option value="fun">Fun</option>
<option value="utility">Utility</option>
+67 -1
View File
@@ -1,2 +1,68 @@
<%- include('../includes/header.ejs', { title: bot.name, bot: bot}) %>
<br><br><br><br>
<div class="flex space-x-4 py-2 lg:h-5/6 sm:min-h-min">
<div class="p-10 bg-blue-color w-2/3 text-white h-full m-4 mx-14">
<pre><br><%= bot.long_description %></pre>
</div>
<div class="bg-blue-color w-1/4 p-10 text-white h-full m-4 ">
<!-- bot avatar image -->
<img class="w-full rounded-full" src="<%= bot.icon %>" alt="<%= bot.name %>" onerror="this.src='https://cdn.discordapp.com/avatars/<%= bot.id %>/<%=bota.avatar %>.webp'">
<h1 class="text-3xl text-center">
<%= bot.name %>
</h1>
<a href="/bot/<%= bot.id %>/join" class="button float-right"><i class="fa fa-link"></i>
Invite</a>
<% if(user) {
bot.owners.forEach(a=>{
if(a.id == user.id) {
%>
<div class="h6 mt-4">
<i class="fa fa-user-crown"></i>Owner Options
</div>
<a href="/bot/<%= bot.id %>/edit" class="button float-right"><i class="fa fa-edit"></i>
Edit</a>
<%
}
})
}
%>
<h6 class="text-xl mt-4">
<i class="fa fa-question-circle"></i> Information
</h6>
<% if(bot.users){ %>
<div class="mt-1">
<div class="box-2-p"><i class="mt-1 fa fa-users"></i></div>
<p class="box-2">Members:&nbsp;<%= bot.users %></p>
</p>
</div>
<% } %>
<% if(bot.servers){ %>
<div class="mt-1">
<div class="box-2-p"><i class="mt-1 fa fa-server"></i></div>
<p class="box-2">Servers:&nbsp;<%= bot.servers %></p>
</p>
</div>
<% } %>
<div class="mt-1">
<div class="box-2-p"><i class="mt-1 fa fa-users"></i></div>
<p class="box-2">Votes:&nbsp;<%= bot.votes || 0 %>
</p>
</div>
<div class="h6 mt-4">
<i class="fa fa-crown"></i> Owners
</div>
<% owners.forEach(admin=>{
%>
<a style="text-decoration: none;margin-bottom: -5px;" href="/user/<%= admin.id %>" class="flex mt-1">
<div class="h-5 w-5 rounded-lg" style="background: url(<%= "https://cdn.discordapp.com/avatars/" + admin.id + "/" + admin.avatar + ".webp" || '../../img/undefined_avatar.png' %>) center center no-repeat; background-size: 100%;">
</div>
<p translate="no" class="box-2">
<%=admin.username %>
</p>
</a>
<% }) %>
<%- include('../includes/header.ejs', {title: 'Bot' }) %>
</div>
</div>
<br><br><br>
<%- include('../includes/footer.ejs') %>
View File
Whitespace-only changes.
+162
View File
@@ -0,0 +1,162 @@
<%- 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) { %>
<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
</h2>
<p class="content text-white text-center" style="opacity:.6">These bots are featured on BotsCord!</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 %>
</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-shuffle" aria-hidden="true"></i> Random Bots
</h2>
<p class="content text-white text-center" style="opacity:.6">We rolled the dice and got this nice bots!</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 %>
</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 %>
</a>
<% }) %>
</div>
<% } %>
</div>
<% } } %>
</div>
</div>
<%- include('./includes/footer.ejs') %>
+19
View File
@@ -17,6 +17,25 @@
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<!-- meta -->
<meta name="description"
content="BotsCord is a Discord bot that allows you to create your own Discord bot and have it run on your server.">
<meta name="keywords" content="bots, bot, discord, botscord, botscord.xyz">
<% if(typeof server !="undefined" ) { %>
<meta property="og:title" content="BotsCord.xyz" />
<meta property="og:url" content="http://botscord.xyz/server/<%=server.id %>" />
<meta property="og:image" content="<%= server.icon %>" />
<meta property="og:description" content="<%= server.description %> Members: <%= server.members %>" />
<% } %>
<meta property="og:title" content="BotsCord.xyz" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://botscord.xyz" />
<meta property="og:image" content="http://botscord.xyz/img/logo.png" />
<meta property="og:description"
content="Botscord is a place where you can promote and vote for your favorite bot/server!" />
<meta name="theme-color" content="#FF0000">
<meta name="author" content="BotsCord">
<meta name="robots" content="index, follow">
</head>
<body class="bg-primary-color">
+101 -130
View File
@@ -1,10 +1,9 @@
<%- include("./includes/header.ejs", { user:user }) %>
<div class="bg-blue-color bg-primary-color p-2 pl-10 pr-10" style="position: relative; top: 0px;">
<div class="bg-blue-color bg-primary-color p-2 pl-10 pr-10" style="position: relative; top: 0px;">
<div class="container-sm mx-auto px-3 mb-5 mt-1 h-fit p-1">
<div class="mb-3 mx-auto h-fit">
<span style="float: right; margin-right: 10%;" class="logo">
<img draggable="false" title="botscord.site" src="/img/logo.png" width="320"
alt="Discord Bots | Discord Bot List">
<img draggable="false" title="botscord.site" src="/img/logo.png" width="320" alt="Discord Bots | Discord Bot List">
</span>
<br><br>
<h1 class="text-xl" style="font-weight:800;color:#fff">BotsCord</h1>
@@ -14,46 +13,29 @@
<label for="simple-search" class="sr-only">Search</label>
<div class="relative w-3/6">
<div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
<svg aria-hidden="true" class="w-5 h-5 text-primary-color dark:text-primary-color" fill="currentColor"
viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
clip-rule="evenodd"></path>
<svg aria-hidden="true" class="w-5 h-5 text-primary-color dark:text-primary-color" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd"></path>
</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>
<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>
<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>
<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>
<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>&nbsp;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>&nbsp;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>&nbsp;Logging</a>
<a title="BotsCord" href="/tag/Utility"
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-cogs"></i>&nbsp;Utility</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-magic"></i>&nbsp;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>&nbsp;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>&nbsp;Logging</a>
<a title="BotsCord" href="/tag/Utility" 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-cogs"></i>&nbsp;Utility</a>
<br><br><br><br>
</div>
</div>
</div>
<!-- bots section -->
<div class="promotedbots">
</div>
<!-- bots section -->
<div class="promotedbots">
<% var nbots=bots.filter(a=> a.promoted == true)
nbots.forEach((val, key) => {
randomIndex = Math.ceil(Math.random()*(key + 1));
@@ -67,15 +49,14 @@
</h2>
<p class="content text-white text-center" style="opacity:.6">These bots are featured on BotsCord!</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">
<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="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 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 %>
@@ -85,20 +66,17 @@
</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">
<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">
<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 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>
@@ -107,8 +85,8 @@
<% } %>
<% } %>
</div>
</div>
<div class="randombots">
</div>
<div class="randombots">
<% var nbots=bots.filter(a=> a.verified == true)
nbots.forEach((val, key) => {
randomIndex = Math.ceil(Math.random()*(key + 1));
@@ -122,15 +100,14 @@
</h2>
<p class="content text-white text-center" style="opacity:.6">We rolled the dice and got this nice bots!</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">
<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="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 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 %>
@@ -140,12 +117,10 @@
</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">
<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">
<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>
@@ -160,9 +135,8 @@
</div>
<% } } %>
</div>
</div>
<!-- server section -->
<div class="promotedservers">
</div>
<div class="promotedservers">
<% var nbots=servers.filter(a=> a.promoted == true)
nbots.forEach((val, key) => {
randomIndex = Math.ceil(Math.random()*(key + 1));
@@ -176,15 +150,15 @@
</h2>
<p class="content text-white text-center" style="opacity:.6">These servers are featured on BotsCord!</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">
<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="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 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <%if(bot.members) { %><i class="fa fa-user"></i>: <%= bot.members %><% } %></p>
</p>
</div>
<div class="px-6 py-4">
<div class="font-bold text-xl mb-2 text-white">
<%= bot.name %>
@@ -194,68 +168,11 @@
</p>
</div>
<div class="px-6 pt-4 pb-2">
<a href="/server/<%= bot.id %>"
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
<a href="/server/<%= 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="/server/<%= 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="randomservers">
<% var nbots=servers
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 Servers
</h2>
<p class="content text-white text-center" style="opacity:.6">We rolled the dice and got this nice Servers!</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="<% bot.icon %> " onerror="this.src='/img/logo.png'"
alt="<%= bot.name %>">
<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="/server/<%= 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="/server<%= 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" data-toggle="tooltip" title="Join the server" data-placement="top">
<i class="fa fa-link" aria-hidden="true"></i> Invite
<a href="/server/<%= 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> Join
</a>
</div>
<% if(bot.tags) {%>
@@ -270,5 +187,59 @@
<% } %>
<% } %>
</div>
</div>
<div class="randomservers">
<% var nbots=servers
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 Servers
</h2>
<p class="content text-white text-center" style="opacity:.6">We rolled the dice and got this nice Servers!</p>
</div>
<%- include("./includes/footer.ejs") %>
<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="<% bot.icon %> " onerror="this.src='/img/logo.png'" alt="<%= bot.name %>">
<% if (bot.votes || bot.members){ %>
<div class="px-6 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes %> <i class="fa fa-user"></i>: <%= bot.members %>
</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="/server/<%= 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="/server<%= 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" data-toggle="tooltip" title="Join the server" data-placement="top">
<i class="fa fa-link" aria-hidden="true"></i> Join
</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>
<%- include("./includes/footer.ejs") %>
+12 -26
View File
@@ -1,13 +1,11 @@
<!-- add servers for the website -->
<%- include('../includes/header.ejs', {title: 'Add server' }) %>
<!-- create form -->
<div class="container-sm p-10">
<!-- create form -->
<div class="container-sm p-10">
<form method="post" action="">
<div class="grid md:grid-cols-2 md:gap-6">
<div class="relative z-0 mb-6 w-full group">
<select name="serverid"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required>
<select name="serverid" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required>
<% for (var i=0; i < user.guilds.length; i++) { %>
<option value="<%= user.guilds[i].id %>">
<%= user.guilds[i].name %>
@@ -16,35 +14,24 @@
</select>
</div>
<div class="relative z-0 mb-6 w-full group">
<input type="text" name="server_invite" 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="floating_last_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
<input type="text" name="server_invite" 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="floating_last_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
ID</label>
</label>
</div>
</div>
<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
<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>
</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 />
<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
<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 />
<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>
<div class="relative z-0 mb-6 w-full group">
<select multiple name="tags"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required>
<select multiple name="tags" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required>
<option value="development">Development</option>
<option value="fun">Fun</option>
<option value="media">Media</option>
@@ -61,7 +48,6 @@
<option value="challange">Challange</option>
</select>
</div>
<button type="submit"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Submit</button>
<button type="submit" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Submit</button>
</form>
</div>
</div>
+9 -18
View File
@@ -1,27 +1,19 @@
<%- include("../includes/header.ejs", {title: "Edit " + server.name}) %>
<!-- create form -->
<div class="container-sm p-10">
<!-- create form -->
<div class="container-sm p-10">
<form method="post" action="">
<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"><%= server.long_description %></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
<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"><%= server.long_description %></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>
</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 value="<%= server.description %>"/>
<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
<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 value="<%= server.description %>" />
<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>
<div class="relative z-0 mb-6 w-full group">
<select multiple name="tags"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
required>
<select multiple name="tags" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required>
<option value="development">Development</option>
<option value="fun">Fun</option>
<option value="media">Media</option>
@@ -38,7 +30,6 @@
<option value="challange">Challange</option>
</select>
</div>
<button type="submit"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Update</button>
<button type="submit" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Update</button>
</form>
</div>
</div>
+21 -18
View File
@@ -1,10 +1,12 @@
<%- include('../includes/header.ejs', { title: server.name}) %>
<br><br><br><br>
<div class="flex space-x-4 py-2 lg:h-5/6 sm:min-h-min">
<%- include('../includes/header.ejs', { title: server.name, server: server}) %>
<br><br><br><br>
<div class="flex space-x-4 py-2 lg:h-5/6 sm:min-h-min">
<div class="p-10 bg-blue-color w-2/3 text-white h-full m-4 mx-14">
<%= server.long_description %>
<pre><br><%= server.long_description %></pre>
</div>
<div class="bg-blue-color w-1/4 p-10 text-white h-full m-4 ">
<% console.log(serverr) %>
<img class="w-full rounded-full" src="<%= serverr.icon %>" alt="<%= server.name %>" onerror="this.src='/img/logo.png'">
<h1 class="text-3xl">
<%= server.name %>
</h1>
@@ -13,7 +15,7 @@
<% if(user) { if(serverr.members.cache.get(user.id)) {
if(serverr.members.cache.get(user.id).permissions.has('ADMINISTRATOR')) { %>
<div class="h6 mt-4">
<i class="fa fa-user-crown"></i>Owner Options
<i class="fa user-crown"></i>Owner Options
</div>
<a href="/server/<%= server.id %>/edit" class="mt-1">
<div class="box-2-p"><i class="mt-1 fa fa-pencil"></i></div>
@@ -21,9 +23,13 @@
</a>
<% } } } %>
<h6 class="text-xl mt-4">
<i class="fa fa-question-circle"></i>
<p>Information</p>
<i class="fa fa-question-circle"></i> Information
</h6>
<div class="mt-1">
<div class="box-2-p"><i class="mt-1 fa fa-users"></i></div>
<p class="box-2">Votes:&nbsp;<%= bot.votes || 0 %>
</p>
</div>
<div class="mt-1">
<div class="box-2-p"><i class="mt-1 fa fa-users"></i></div>
<p class="box-2">Members:&nbsp;<%= serverr.memberCount.toLocaleString().replace(',', '.' ) %>
@@ -50,31 +56,28 @@
</p>
</div>
<div class="h6 mt-4">
<i class="fa fa-user-crown"></i> Owners
<i class="fa fa-crown"></i> Owners
</div>
<% serverr.members.cache.filter(a=> !a.user.bot && a.permissions.has('ADMINISTRATOR')).map(admin =>{
%>
<a style="text-decoration: none;margin-bottom: -5px;" href="/user/<%= admin.user.id %>"
class="flex mt-1">
<div class="h-5 w-5 rounded-lg"
style="background: url(<%= admin.user.avatarURL({dynamic:true}) || '../../img/undefined_avatar.png' %>) center center no-repeat; background-size: 100%;">
<a style="text-decoration: none;margin-bottom: -5px;" href="/user/<%= admin.user.id %>" class="flex mt-1">
<div class="h-5 w-5 rounded-lg" style="background: url(<%= admin.user.avatarURL({dynamic:true}) || '../../img/undefined_avatar.png' %>) center center no-repeat; background-size: 100%;">
</div>
<p translate="no" class="box-2">
<%= admin.user.tag %>
<% if(admin.user.id===serverr.ownerID) { %>
&nbsp;<span data-toggle="tooltip" title="Join the server"><i
class="fa fa-crown has-text-warning"></i></span>
&nbsp;<span data-toggle="tooltip" title="Join the server"><i class="fa fa-crown has-text-warning"></i></span>
<% } %>
</p>
</a>
<% }) %>
</div>
</div>
<br><br><br>
</div>
<br><br><br>
<%- include('../includes/footer.ejs') %>
<!-- <% /*, meta: {
<%- 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