This commit is contained in:
CorwinDev committed 2022-08-18 14:44:12 +02:00
1 parent 29fff68ff0
commit f16305c6ad
25 files changed
+973 -244

No files matched your search

+1
View File
@@ -18,6 +18,7 @@ let hm = new mongoose.Schema({
analytics: Object,
analytics_visitors: Number,
analytics_invites: Number,
vanity: String,
});
module.exports = mongoose.model("bots", hm);
+1
View File
@@ -18,6 +18,7 @@ let hm = new mongoose.Schema({
analytics_visitors: Number,
analytics_joins: Number,
country: Object,
vanity: String,
});
module.exports = mongoose.model("servers", hm);
+3
View File
@@ -44,11 +44,14 @@
"passport": "^0.6.0",
"passport-discord": "^0.1.4",
"request": "^2.88.2",
"sanitize-html": "^2.7.1",
"showdown": "^2.1.0",
"tailwindcss": "^3.1.7",
"url": "^0.11.0"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.4",
"@types/sanitize-html": "^2.6.2",
"postcss-nesting": "^10.1.10"
}
}
+1
View File
@@ -2,5 +2,6 @@ module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
require('@tailwindcss/typography'),
]
}
+3 -1
View File
@@ -4,6 +4,7 @@ module.exports = {
"./website/**/*.{html,css}",
"./website/views/*.ejs",
"./website/views/**/*.ejs",
"./website/views/**/**/*.ejs",
],
theme: {
extend: {
@@ -19,12 +20,13 @@ module.exports = {
serif: ["Georgia", "serif"],
mono: ["Menlo", "monospace"]
},
}
},
},
plugins: [
{
tailwindcss: {},
autoprefixer: {},
typography: {}
},
],
};
+33 -3
View File
@@ -9,7 +9,7 @@ const colors = require('colors');
const commands = [
new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),
new SlashCommandBuilder().setName('topvoted').setDescription('Replies with highest server/bots!'),
new SlashCommandBuilder().setName('user').setDescription('Replies with user info and connected bots/servers!'),
new SlashCommandBuilder().setName('profile').setDescription('Replies with user info and connected bots/servers!'),
new SlashCommandBuilder().setName('queue').setDescription('Replies with queue'),
]
.map(command => command.toJSON());
@@ -60,8 +60,38 @@ client.on('interactionCreate', async interaction => {
interaction.reply({ embeds: [embed] });
} else if (commandName === 'user') {
const { user } = interaction;
await interaction.reply(`${user.username}#${user.discriminator} has ${user.bot ? 'a bot' : 'no bot'} and is connected to ${user.guilds.size} servers!`);
bots.find({ owner: user.id }).then(bots => {
var bots1 = bots
.map(
a => `${a.name} | ${a.id} **[ \`${a.votes}\` Votes ]**`
)
.join('\n');
if (!bots1) {
var bots1 = 'no bots';
}
const embed = new EmbedBuilder()
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL({ dynamic: true }) })
.setColor("#7289da")
.setDescription(`**Bots owned by ${user.tag}**\n${bots1}`)
interaction.reply({ embeds: [embed] });
}).catch(console.error);
} else if (commandName === 'profile') {
bots.find({ owner: interaction.user.id }).then(async function(bots){
var bots1 = bots
.map(
a => `${a.name} | ${a.id} **[ \`${a.votes}\` Votes ]**`
)
.join('\n');
if (!bots1) {
var bots1 = 'no bots';
}
var user = await users.findOne({ id: user.id });
const embed = new EmbedBuilder()
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL({ dynamic: true }) })
.setColor("#7289da")
.setDescription(`**Bots owned by ${user.tag}**\n${bots1}\nCoins: ${user.coins}`)
interaction.reply({ embeds: [embed] });
})
} else if (commandName === 'queue') {
if (!global.config.users.owner.includes(interaction.user.id) && !global.config.users.verificator.includes(interaction.user.id)) return interaction.reply('You are not allowed to use this command!');
const unVerified = await bots.find({ verified: false });
+3 -3
View File
@@ -166,9 +166,9 @@ app.get('/tag/:id', async (req, res) => {
});
app.get('/i/:id', async (req, res) => {
var id = req.params.id.toLowerCase();
var bott = await bots.findOne({ name: { $regex: req.params.id }});
var bott = await bots.findOne({ vanity: id });
if(!bott){
var serverr = await server.findOne({ name: { $regex: req.params.id }});
var serverr = await server.findOne({ vanity: id });
if(!serverr){
res.redirect('/');
return
@@ -176,7 +176,7 @@ app.get('/i/:id', async (req, res) => {
res.redirect('/server/' + serverr.id + '/join');
return
}
res.redirect('/bot/' + bott.id + '/join');
res.redirect('/bot/' + bott.id + '/invite');
return
});
File diff suppressed because it is too large. Load diff
-46
View File
@@ -44,49 +44,3 @@ body {
display: none;
}
}
/*
:root {
--bg: #18191C;
--blue-color-hover: #4554F2;
--bg-section-hover: #27282D;
--color-result-shadow: #1E2023;
--bg-button-dark: #1E2023;
--bg-button-dark-hover: #26282B;
--bg-footer: #27282D;
--form-background: #18191C;
--form-input: #1E2023;
--input-disabled: #26282B;
--tooltip-bg: #000;
}
[data-theme="light"] {
--bg-card: #D4D5D7;
--bg-section: #5865F2;
--bg-section-hover: #ECECEC;
--text-section-hover: #000;
--text-section: #fff;
--bg-body: #F5F5F5;
--button-green: #5865F2;
--button-green-hover: #4554F2;
--button-text-section: #fff;
--button-text: #000;
--color-result-shadow: #ECECEC;
--color-result-text: #000;
--body-text: #000;
--body-icon: #5865F2;
--bg-button-dark: #ECECEC;
--bg-button-dark-hover: #C7C6C6;
--bg-footer: #515CDA;
--footer-text: #fff;
--footer-text-hover: #18191C;
--color-dropdown: #D4D5D7;
--button-text-section: #fff;
--form-background: #D4D5D7;
--form-input: #ECECEC;
--input-disabled: #C7C6C6;
--label-color: #000;
--input-color: #000;
--tooltip-bg: #000;
--tooltip-text: #fff;
}*/
+90 -2
View File
@@ -25,14 +25,23 @@ router.get('/', async function (req, res) {
}
})
router.get('/bot/:d', async function (req, res) {
router.get('/bot/:d/:f', 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 });
if (req.params.f == 'reject') {
res.render('admin/bot', {
user: req.user,
bots: bot
bots: bot,
reject: true
});
} else if (req.params.f == 'accept') {
res.render('admin/bot', {
user: req.user,
bots: bot,
accept: true
});
}
} else {
res.redirect('/');
}
@@ -42,4 +51,83 @@ router.get('/bot/:d', async function (req, res) {
}
})
router.get('/bot/:d/:f', async function (req, res) {
if (req.user) {
if (global.config.users.verificator.includes(req.user.id) || global.config.users.owner.includes(req.user.id)) {
var bot = await bots.findOne({ id: req.params.d });
if (!bot) {
return res.redirect('/');
}
if (req.params.f == 'reject') {
res.render('admin/bot', {
user: req.user,
bots: bot,
accept: true
});
} else if (req.params.f == 'verify') {
res.render('admin/bot', {
user: req.user,
bots: bot,
verify: true
});
} else {
res.redirect('/admin');
}
} else {
res.redirect('/');
}
} else {
req.session.backURL = req.originalUrl;
res.redirect('/auth');
}
})
router.post('/bot/:d/:f', async function (req, res) {
if (req.user) {
if (global.config.users.verificator.includes(req.user.id) || global.config.users.owner.includes(req.user.id)) {
var bot = await bots.findOne({ id: req.params.d });
if (!bot) {
res.redirect('/admin');
}
if (req.params.f == 'reject') {
bot.owners.forEach(async function (owner) {
global.client.users.fetch(owner).then(async function (user) {
try {
user.send(`Your bot ${bot.name} has been rejected by the admin. With the reason: ${req.body.reason}`);
global.client.channels.cache.get(global.config.bot.channels.new).send(`${bot.name} has been rejected by the admin. With the reason: ${req.body.reason}`);
}
catch (e) {
}
})
})
var rem = await bots.findOneAndDelete({ id: req.params.d })
if (rem) {
res.redirect('/admin');
} else {
res.redirect('/admin');
}
} else if (req.params.f == 'verify') {
bot.verified = true;
bot.save();
bot.owners.forEach(async function (owner) {
global.client.users.fetch(owner).then(async function (user) {
try {
user.send(`Your bot ${bot.name} has been accepted by the admin.`);
global.client.channels.cache.get(global.config.bot.channels.new).send(`${bot.name} has been accepted by the admin. View it at: https://botscord.xyz/bot/${bot.id}`);
}
catch (e) {
}
})
})
res.redirect('/admin');
}
} else {
res.redirect('/');
}
} else {
req.session.backURL = req.originalUrl;
res.redirect('/auth');
}
})
module.exports = router;
+130 -13
View File
@@ -5,6 +5,9 @@ var votes = require('../../../models/votes');
const client = require('../../index');
var getIP = require('ipware')().get_ip;
var geoip = require('geoip-lite');
var showdown = require('showdown'),
converter = new showdown.Converter()
const sanitizeHtml = require('sanitize-html');
function makeid(length) {
var result = '';
@@ -22,7 +25,11 @@ router.get('/', function () {
})
router.get('/add', function (req, res) {
if (req.user) {
res.render('bot/add', { user: req.user });
res.render('bot/add', {
user: req.user,
message: req.session.message || undefined,
error: req.session.error || undefined,
});
return
} else {
req.session.backURL = req.originalUrl;
@@ -81,6 +88,35 @@ router.get('/:botID', async function (req, res) {
req.session.error = "No bot found";
return res.redirect('/');
}
if (bot.verified == false) {
if(!req.user) {
req.backURL = req.originalUrl;
return res.redirect('/auth');
}
if (bot.owners.includes(req.user.id)) {
let coowner = new Array()
await bot.owners.forEach(async function (a) {
try {
var b = await global.bsl.users.fetch(a)
} catch (e) {
}
if (!b) return;
coowner.push(b)
})
var html = converter.makeHtml(bot.long_description);
html = sanitizeHtml(html)
res.render('bot/index', {
bot: bot,
user: req.user,
owners: coowner,
bota: await global.bsl.users.fetch(bot.id),
description: html
});
} else {
req.session.error = "Bot not verified";
return res.redirect('/');
}
} else {
let referresURL = String(req.headers.referer).replace("undefined", "Unkown").split('.').join(',');
await bots.updateOne({
id: req.params.botID
@@ -132,12 +168,16 @@ router.get('/:botID', async function (req, res) {
req.session.error = "No bot found";
return res.redirect('/');
}
var html = converter.makeHtml(bot.long_description);
html = sanitizeHtml(html)
res.render('bot/index', {
bot: bot,
user: req.user,
owners: coowner,
bota: bota
bota: await global.bsl.users.fetch(bot.id),
description: html
});
}
})
})
@@ -155,11 +195,17 @@ router.get('/:botID/settings', async function (req, res) {
req.session.error = "No bot found";
return res.redirect('/');
}
if (bot.owners.includes(req.user.id)) {
res.render('bot/edit', {
bot: bot,
user: req.user,
message: req.session.message || undefined,
error: req.session.error || undefined,
});
} else {
req.session.error = "You are not the owner of this bot";
res.redirect('/');
}
});
}
});
@@ -178,12 +224,18 @@ router.get('/:botID/analytics', async function (req, res) {
req.session.error = "No bot found";
return res.redirect('/');
}
if (bot.owners.includes(req.user.id)) {
res.render('bot/analytics', {
bot: bot,
user: req.user,
bota: await global.bsl.users.fetch(bot.id)
bota: await global.bsl.users.fetch(bot.id),
message: req.session.message || undefined,
error: req.session.error || undefined,
});
} else {
req.session.error = "You are not the owner of this bot";
res.redirect('/');
}
});
}
});
@@ -203,14 +255,24 @@ router.post('/:botID/settings', async function (req, res) {
return res.redirect('/');
}
if (!bot.owners.includes(req.user.id)) {
req.session.error = "You do not have permission to edit this bot";
return res.redirect('/');
}
bots.findOne({ vanity: req.body.bot_vanity }, async function (err, bot2) {
if (err) {
console.log(err);
return res.redirect('/');
}
if (bot2) {
if (bot2.id != bot.id) {
req.session.error = "This vanity is already in use";
return res.redirect('/');
} else {
bot.name = req.body.bot_name;
bot.description = req.body.bot_short;
bot.long_description = req.body.bot_description;
bot.vanity = req.body.bot_vanity.toLowerCase();
bot.save(function (err) {
if (err) {
console.log(err);
@@ -218,12 +280,42 @@ router.post('/:botID/settings', async function (req, res) {
res.redirect('/');
} else {
req.session.message = "Bot updated";
res.redirect('/');
res.redirect('/bot/' + req.params.botID + '/settings');
}
});
}
} else {
servers.findOne({ vanity: req.body.bot_vanity }, async function (err, server) {
if (err) {
console.log(err);
return res.redirect('/');
}
if (server) {
req.session.error = "This vanity is already in use";
return res.redirect('/');
} else {
bot.name = req.body.bot_name;
bot.description = req.body.bot_short;
bot.long_description = req.body.bot_description;
bot.vanity = req.body.bot_vanity.toLowerCase();
bot.save(function (err) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
res.redirect('/');
} else {
req.session.message = "Bot updated";
res.redirect('/bot/' + req.params.botID + '/settings');
}
});
}
});
}
});
})
}
});
router.get('/:botID/vote', async function (req, res) {
if (!req.user) {
req.session.backURL = req.originalUrl;
@@ -264,13 +356,13 @@ router.get('/:botID/vote', async function (req, res) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
return res.redirect('/');
return res.redirect('/bot/' + req.params.botID);
}
})
global.client.channels.cache.get(global.config.bot.channels.vote).send(`${req.user.username} has voted for bot: ${bot.name} | <https://botscord.xyz/bot/${bot.id}>`);
req.session.message = "Vote added";
return res.redirect('/');
return res.redirect('/bot/' + req.params.botID);
})
} else {
// add vote to database
@@ -283,7 +375,7 @@ router.get('/:botID/vote', async function (req, res) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
return res.redirect('/');
return res.redirect('/bot/' + req.params.botID);
} else {
if (bot.votes) {
bot.votes = 1;
@@ -294,11 +386,11 @@ router.get('/:botID/vote', async function (req, res) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
return res.redirect('/');
return res.redirect('/bot/' + req.params.botID);
} else {
global.client.channels.cache.get(global.config.bot.channels.vote).send(`${req.user.username} has voted for bot: ${bot.name} | <https://botscord.xyz/bot/${bot.id}>`);
req.session.message = "Vote added";
return res.redirect('/');
return res.redirect('/bot/' + req.params.botID);
}
})
}
@@ -309,4 +401,29 @@ router.get('/:botID/vote', async function (req, res) {
}
})
router.get('/:botID/invite', async function (req, res) {
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('/');
}
if (!bot.invite) {
var invite = "https://discord.com/oauth2/authorize?client_id=" + bot.id + "&scope=bot&permissions=8";
return res.render('bot/join', {
bot: bot,
invite: invite,
})
}
return res.render('bot/join', {
bot: bot,
invite: bot.invite,
})
})
})
module.exports = router;
+50 -6
View File
@@ -2,6 +2,7 @@ var express = require('express'),
router = express.Router();
var servers = require('../../../models/server');
var votes = require('../../../models/votes');
var bots = require('../../../models/bot');
const client = require('../../../index');
const Discord = require('discord.js');
var showdown = require('showdown'),
@@ -188,7 +189,9 @@ router.get('/:server/settings',async function (req, res) {
res.render('server/edit', {
user: req.user,
server: server,
serverr: serverr
serverr: serverr,
message: req.session.message || undefined,
error: req.session.error || undefined,
});
} else {
req.session.error = "You don't have permission to edit this server";
@@ -206,7 +209,7 @@ router.post('/:server/settings', async function (req, res) {
req.session.backURL = req.originalUrl;
res.redirect('/auth');
}
servers.findOne({ id: req.params.server }, function (err, server) {
servers.findOne({ id: req.params.server }, async function (err, server) {
if (err) {
console.log(err);
return res.redirect('/');
@@ -215,21 +218,62 @@ router.post('/:server/settings', async function (req, res) {
req.session.error = "No server found";
return res.redirect('/');
}
var serverr = global.client.guilds.cache.get(server.id)
var serverr = await global.bsl.guilds.cache.get(server.id)
if (serverr.members.cache.get(req.user.id)) {
if (serverr.members.cache.get(req.user.id).permissions.has('ADMINISTRATOR')) {
servers.findOne({ vanity: req.body.server_vanity }, async function (err, server2) {
if (err) {
console.log(err);
return res.redirect('/server/' + req.params.server + '/settings');
}
if (server2) {
if (server2.id != req.params.server) {
req.session.error = "Vanity already exists";
return res.redirect('/server/' + req.params.server + '/settings');
} else {
server.description = req.body.server_short;
server.long_description = req.body.server_description;
server.tags = req.body.tags;
server.webhook = req.body.server_webhook;
server.vanity = req.body.server_vanity.toLowerCase();
server.save(function (err) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
res.redirect('/');
res.redirect('/server/' + req.params.server + '/settings');
} else {
req.session.message = "Server edited";
res.redirect('/');
res.redirect('/server/' + req.params.server + '/settings');
}
});
}
} else {
bots.findOne({ vanity: req.body.server_vanity }, async function (err, bot) {
if (err) {
console.log(err);
return res.redirect('/server/' + req.params.server + '/settings');
}
if (bot) {
req.session.error = "Vanity already exists";
return res.redirect('/server/' + req.params.server + '/settings');
} else {
server.description = req.body.server_short;
server.long_description = req.body.server_description;
server.tags = req.body.tags;
server.webhook = req.body.server_webhook;
server.vanity = req.body.server_vanity.toLowerCase();
server.save(function (err) {
if (err) {
console.log(err);
req.session.error = "Something went wrong";
res.redirect('/server/' + req.params.server + '/settings');
} else {
req.session.message = "Server edited";
res.redirect('/server/' + req.params.server + '/settings');
}
});
}
})
}
});
} else {
@@ -300,7 +344,7 @@ router.get('/:server/vote', function (req, res) {
}
global.client.channels.cache.get(global.config.bot.channels.vote).send(`${req.user.username} has voted for server ${bot.name} | <https://botscord.xyz/server/${bot.id}>`);
req.session.message = "Vote added";
return res.redirect('/');
return res.redirect('/bot/' + bot.id);
})
} else {
// add vote to database
+15 -38
View File
@@ -1,39 +1,16 @@
<%- 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>
<div class="overflow-x-auto relative container-sm text-center">
<% if(typeof reject != "undefined") { %>
<form action="" method="post">
<h1 class="text-xl text-white">Are you sure you want to reject this bot?</h1>
<p class="text-white">Reason: <input type="text " name="reason" class=" text-black "></p>
<input type="submit" value="Yes" name="reject" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full">
<input type="submit" value="No" class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full" onclick="location.href='/admin'">
</form>
<% } %>
<% if(typeof verify != "undefined") { %>
<form action="" method="post">
<h1 class="text-xl">Are you sure you want to verify this bot?</h1>
<input type="submit" value="Yes" name="verify" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full" onclick="location.href='/admin/bot/<%= bots.id %>/verify'">
</form>
<% } %>
+14 -1
View File
@@ -15,12 +15,15 @@
<th scope="col" class="py-3 px-6">
Owner
</th>
<th scope="col" class="py-3 px-6">
Verify
</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 %>'">
<tr class="hover:bg-gray-100 dark:hover:bg-gray-800">
<td class="py-3 px-6">
<%= bot.name %>
</td>
@@ -33,6 +36,16 @@
<td class="py-3 px-6">
<%= bot.owner %>
</td>
<td class="py-3 px-6">
<form action="/admin/bot/<%= bot.id %>/verify" method="post">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full" type="submit">
Verify
</button>
</form>
<button class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full" onclick="location.href='/admin/bot/<%= bot.id %>/reject'">
Reject
</button>
</td>
</tr>
<% }) %>
+15 -2
View File
@@ -16,11 +16,24 @@
<input type="text" name="bot_short" id="floating_last_name" class="block py-2.5 px-0 w-full text-sm text-white 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="<%= bot.description %>" />
<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><br>
</div>
<div class="relative z-0 mb-6 w-full group">
<input type="text" name="bot_vanity" id="bot_vanity" class="block py-2.5 px-0 w-full text-sm text-white 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=" " value="<%= bot.vanity %>" />
<label for="bot_vanity" 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">Fill this in to get a vanity url invite.</label>
<span class="text-white text-xs" id="vanity">https://botscord.xyz/i/</span>
</div>
<script>
var vanity = document.getElementById("vanity");
vanity.innerHTML = vanity.innerHTML + "<%= bot.vanity %>";
var change = document.getElementById("bot_vanity");
change.addEventListener("keyup", function() {
vanity.innerHTML = "https://botscord.xyz/i/" + change.value;
});
</script>
<br>
<h1 class="text-xl text-white">This token can be used to access your bot via our api</h1>
<a href="/docs/api" class="text-sm text-white hover:text-blue-600 underline ">
<h1 class="text-sm text-white hover:text-blue-600">Access api docs</h1>
</a>
<div class="relative z-0 mb-6 w-full group">
<input type="text" id="token" class="block py-2.5 px-0 w-full text-sm text-white 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="<%= bot.token %>" onclick="copy()" />
+7 -1
View File
@@ -2,7 +2,13 @@
<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>
<article class="prose prose-xl text-white">
<br><%- description %>
</article>
<div class="prose">
</div>
</div>
<div class="bg-blue-color w-1/4 p-10 text-white h-full m-4 ">
<!-- bot avatar image -->
+19
View File
@@ -0,0 +1,19 @@
<%- include('../includes/header.ejs', {title: 'Join' + bot.name}) %>
<div class="flex flex-col items-center justify-center h-screen ">
<div class="w-96 h-96 bg-blue-color text-white text-center rounded-lg items-center">
<h1 class="text-3xl font-bold p-5">Join <%= bot.name %></h1>
<p>You will be redirected after 3 seconds </p>
<div class="flex justify-center">
<image src="/gif/loading.gif">
<span class="sr-only">Loading...</span>
</div>
Press <a href="<%- invite %>">here</a> if you are not redirected.
</div>
<script>
setTimeout(function() {
window.location.href = '<%- invite %>';
}, 3000);
</script>
</div>
</div>
<%- include('../includes/footer.ejs') %>
+1
View File
@@ -7,3 +7,4 @@
</div>
</div>
</div>
<div class="prose"></div>
+2 -2
View File
@@ -97,8 +97,8 @@
<div class="hidden origin-top-right absolute mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none items-stretch" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1" id="dropdown" style="z-index: 99 !important;">
<div class="py-1" role="none">
<a href="/invite" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-0"><i class="fas fa-user-plus"></i>Invite</a>
<a href="/discord" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-1"><i class="fa-brands fa-discord"></i>Discord Server</a>
<a href="/i/BSL" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-0"><i class="fas fa-user-plus"></i>Invite</a>
<a href="/i/BotsCord" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-1"><i class="fa-brands fa-discord"></i>Discord Server</a>
</div>
<div class="py-1" role="none">
<a href="/server/add" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-2"><i class="fa fa-solid fa-plus"></i>Add server</a>
+4 -4
View File
@@ -81,7 +81,7 @@
</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) { %>
<% for(let i=0; i < nbots.length; i++) { if (i===5) 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='/bot/<%=bot.id%> ';" style="cursor: pointer;">
<img class="w-full rounded-full" src="<%= bot.icon %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
<div class="px-6 text-white text-base">
@@ -125,7 +125,7 @@
</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) { %>
<% for(let i=0; i < nbots.length; i++) { if (i===5) 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='/bot/<%=bot.id%> ';" style="cursor: pointer;">
<img class="w-full rounded-full" src="<%= bot.icon %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
<div class="px-6 text-white text-base">
@@ -168,7 +168,7 @@
</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) { %>
<% for(let i=0; i < nbots.length; i++) { if (i===5) 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="<%= 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">
@@ -256,7 +256,7 @@
</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) { %>
<% for(let i=0; i < nbots.length; i++) { if (i===5) 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="<%= 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">
+14
View File
@@ -21,6 +21,19 @@
<input type="text" name="server_webhook" id="floating_last_name" class="block py-2.5 px-0 w-full text-sm text-white 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=" " value="<%= server.webhook %>" />
<label for="server_webhook" 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">Discord WebHook to recieve votes.</label>
</div>
<div class="relative z-0 mb-6 w-full group">
<input type="text" name="server_vanity" id="server_vanity" class="block py-2.5 px-0 w-full text-sm text-white 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=" " value="<%= server.vanity %>" />
<label for="server_vanity" 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">Fill this in to get a vanity url invite.</label>
<span class="text-white text-xs" id="vanity">https://botscord.xyz/i/</span>
</div>
<script>
var vanity = document.getElementById("vanity");
vanity.innerHTML = vanity.innerHTML + "<%= server.vanity %>";
var change = document.getElementById("server_vanity");
change.addEventListener("keyup", function() {
vanity.innerHTML = "https://botscord.xyz/i/" + change.value;
});
</script>
<div class="relative z-0 mb-6 w-full group">
<select multiple name="tags" class="bg-gray-50 border border-gray-300 text-white 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>
<% global.config.server.tags.forEach(function(tag) { %>
@@ -30,6 +43,7 @@
</div><br>
<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>
<br>
<!-- show code for banner -->
<span class="text-white">Add this code to your websites to get automatically a banner</span>
<textarea class="text-white" style="width:100%;" rows="2" disabled>
+3 -2
View File
@@ -2,13 +2,14 @@
<div class="flex flex-col items-center justify-center h-screen ">
<div class="w-96 h-96 bg-blue-color text-white text-center rounded-lg items-center">
<h1 class="text-3xl font-bold p-5">Join <%= server.name %></h1>
<p>You will be redirect after 3 seconds </p>
<p>You will be redirected after 3 seconds </p>
<div class="flex justify-center">
<image src="/gif/loading.gif">
<span class="sr-only">Loading...</span>
</div>
</div>
<!-- script to redirect -->
Press <a href="<%- server.invite %>">here</a> if you are not redirected.
<script>
setTimeout(function() {
window.location.href = '<%= server.invite %>';
+2 -2
View File
@@ -18,7 +18,7 @@
<% for(let i=0; i < nbots.length; i++) { var bot=nbots[i]; if(bot) { %>
<% getBot = global.bsl.guilds.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;">
<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 %>">
<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>
@@ -63,7 +63,7 @@
<% } %>
<% for(let i=0; i < nbots.length; i++) { var bot=nbots[i]; if(bot) { %>
<% getBot = global.bsl.guilds.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;">
<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 %>">
<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>
-3
View File
@@ -22,9 +22,6 @@
<label for="website" class="peer-focus:font-medium absolute text-sm 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">Your website </label>
</div>
<br>
<script>
//
</script>
<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>
+9 -2
View File
@@ -3,7 +3,14 @@
<div class="lg:flex space-x-4 py-2 lg:h-5/6 sm:min-h-min">
<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><%= users.biography || "User Has No biography" %></pre>
<pre style="white-space: pre-wrap;" class="text-clip break-wordsw-full h-full"><br>
<% if(typeof users.biography !== 'undefined') { %>
<%= users.biography %>
<% } else { %>
User Has No biography
<%} %>
</pre>
</p><br>
Bots owned by this user: <%= bots.length %><br>
<% if(bots) { %>
@@ -34,7 +41,7 @@
</div>
<% if(typeof users.website != "undefined") { %>
<a href="<%= users.website %>" target="_blank" class="text-white text-clip">
<i class="fab fa-website"></i>
<i class="fa-solid fa-browser"></i>
<%= users.website %>
<br>
</a>