Updated much
This commit is contained in:
1 parent
93b118f874
commit
b2cd1691af
21 files changed
+1476
-169
No files matched your search
Vendored
+1
-1
@@ -3,6 +3,6 @@
|
|||||||
"ejs": "html"
|
"ejs": "html"
|
||||||
},
|
},
|
||||||
"[html]": {
|
"[html]": {
|
||||||
"editor.defaultFormatter": "j69.ejs-beautify"
|
"editor.defaultFormatter": "vscode.html-language-features"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
module.exports = {
|
||||||
|
"mongodb": "mongodb+srv://root:@cluster0.jo9hd.mongodb.net/?retryWrites=true&w=majority",
|
||||||
|
"bot": {
|
||||||
|
token: "ODcwMDAxMjM0NTgzNjIxNzEz.GHwzsE.tvU0FJG9c7HFkLaqDMqp6wTaSBZbFdH6wuaLO0",
|
||||||
|
channels: {
|
||||||
|
login: "868065455628234780",
|
||||||
|
vote: "937643610541793300",
|
||||||
|
error: "1003947531543269507",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
+5
-3
@@ -3,8 +3,6 @@ const { Client, GatewayIntentBits } = require('discord.js');
|
|||||||
const client = new Client({
|
const client = new Client({
|
||||||
intents: [
|
intents: [
|
||||||
GatewayIntentBits.Guilds,
|
GatewayIntentBits.Guilds,
|
||||||
GatewayIntentBits.GuildMembers,
|
|
||||||
GatewayIntentBits.GuildPresences,
|
|
||||||
GatewayIntentBits.GuildMessages,
|
GatewayIntentBits.GuildMessages,
|
||||||
GatewayIntentBits.GuildMessageReactions,
|
GatewayIntentBits.GuildMessageReactions,
|
||||||
GatewayIntentBits.GuildMessageTyping,
|
GatewayIntentBits.GuildMessageTyping,
|
||||||
@@ -12,10 +10,14 @@ const client = new Client({
|
|||||||
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
client.config = require('../config');
|
client.config = require('./config');
|
||||||
// Set intents
|
// Set intents
|
||||||
client.on('ready', () => {
|
client.on('ready', () => {
|
||||||
console.log('Bot is ready!');
|
console.log('Bot is ready!');
|
||||||
|
// Log server count
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log(`${client.guilds.cache.size} servers`);
|
||||||
|
}, 1000);
|
||||||
});
|
});
|
||||||
// Login
|
// Login
|
||||||
client.login(client.config.bot.token);
|
client.login(client.config.bot.token);
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "bot",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
||||||
@@ -1,11 +1,28 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
"mongodb": "mongodb+srv://root:RzIhDff90LKkOOjw@cluster0.jo9hd.mongodb.net/?retryWrites=true&w=majority",
|
"mongodb": "mongodb+srv://root:RzIhDff90LKkOOjw@cluster0.jo9hd.mongodb.net/?retryWrites=true&w=majority",
|
||||||
"bot": {
|
"bot": {
|
||||||
|
"id": "934087523649609768",
|
||||||
"token": "OTM0MDg3NTIzNjQ5NjA5NzY4.GV-g1-.Eggw57JNtsrLPbakg-_yr8fn8oBAbh0nKfK-lk",
|
"token": "OTM0MDg3NTIzNjQ5NjA5NzY4.GV-g1-.Eggw57JNtsrLPbakg-_yr8fn8oBAbh0nKfK-lk",
|
||||||
"channels":{
|
"channels":{
|
||||||
"login": "868065455628234780",
|
"login": "868065455628234780",
|
||||||
"vote": "937643610541793300",
|
"vote": "937643610541793300",
|
||||||
"error": "1003947531543269507",
|
"error": "1003947531543269507",
|
||||||
|
},
|
||||||
|
"bsl" : {
|
||||||
|
"id": "870001234583621713",
|
||||||
|
"token": "OTM0MDg3NTIzNjQ5NjA5NzY4.GV-g1-.Eggw57JNtsrLPbakg-_yr8fn8oBAbh0nKfK-lk",
|
||||||
|
"channels":{
|
||||||
|
"vote":"937643610541793300",
|
||||||
|
"error":"1003947531543269507",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"port": 3000,
|
||||||
|
"host": "http://localhost:3000",
|
||||||
|
},
|
||||||
|
"users": {
|
||||||
|
"owner": [""],
|
||||||
|
"verificator": [""],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
// Load Bot and website
|
|
||||||
const website = require('./website');
|
|
||||||
// Import config and export
|
// Import config and export
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
const mongoose = require('mongoose');
|
const mongoose = require('mongoose');
|
||||||
@@ -29,6 +27,7 @@ client.config = config;
|
|||||||
// Set intents
|
// Set intents
|
||||||
client.on('ready', () => {
|
client.on('ready', () => {
|
||||||
console.log('Bot is ready!');
|
console.log('Bot is ready!');
|
||||||
|
require('./website')
|
||||||
});
|
});
|
||||||
// Login
|
// Login
|
||||||
client.login(client.config.bot.token);
|
client.login(client.config.bot.token);
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
const mongoose = require("mongoose");
|
||||||
|
let hm = new mongoose.Schema({
|
||||||
|
id: String,
|
||||||
|
name: String,
|
||||||
|
verified: Boolean,
|
||||||
|
description: String,
|
||||||
|
owner: String,
|
||||||
|
long_description: String,
|
||||||
|
style: String,
|
||||||
|
tags: [String],
|
||||||
|
premium: Boolean,
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = mongoose.model("servers", hm);
|
||||||
Generated
+779
File diff suppressed because it is too large.
Load diff
@@ -28,6 +28,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"autoprefixer": "^10.4.8",
|
"autoprefixer": "^10.4.8",
|
||||||
"body-parser": "^1.20.0",
|
"body-parser": "^1.20.0",
|
||||||
|
"cookie-session": "^2.0.0",
|
||||||
"discord.js": "^14.1.1",
|
"discord.js": "^14.1.1",
|
||||||
"ejs": "^3.1.8",
|
"ejs": "^3.1.8",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
"mongoose": "^6.5.0",
|
"mongoose": "^6.5.0",
|
||||||
"passport": "^0.6.0",
|
"passport": "^0.6.0",
|
||||||
"passport-discord": "^0.1.4",
|
"passport-discord": "^0.1.4",
|
||||||
|
"request": "^2.88.2",
|
||||||
"showdown": "^2.1.0",
|
"showdown": "^2.1.0",
|
||||||
"tailwindcss": "^3.1.7"
|
"tailwindcss": "^3.1.7"
|
||||||
}
|
}
|
||||||
|
|||||||
+56
-39
@@ -6,13 +6,14 @@ const path = require('path');
|
|||||||
const session = require('express-session');
|
const session = require('express-session');
|
||||||
const passport = require('passport');
|
const passport = require('passport');
|
||||||
var DiscordStrategy = require('passport-discord').Strategy;
|
var DiscordStrategy = require('passport-discord').Strategy;
|
||||||
const MemoryStore = require("memorystore")(session);
|
var MemoryStore = require('memorystore')(session);
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
var showdown = require('showdown'),
|
var showdown = require('showdown'),
|
||||||
converter = new showdown.Converter();
|
converter = new showdown.Converter();
|
||||||
var bot = require('./routers/bot');
|
var bot = require('./routers/bot');
|
||||||
var admin = require('./routers/admin');
|
var admin = require('./routers/admin');
|
||||||
var auth = require('./routers/auth');
|
var auth = require('./routers/auth');
|
||||||
|
var servers = require('./routers/servers');
|
||||||
var client = require('../index');
|
var client = require('../index');
|
||||||
passport.serializeUser(function (user, done) {
|
passport.serializeUser(function (user, done) {
|
||||||
done(null, user);
|
done(null, user);
|
||||||
@@ -20,35 +21,12 @@ passport.serializeUser(function (user, done) {
|
|||||||
passport.deserializeUser(function (obj, done) {
|
passport.deserializeUser(function (obj, done) {
|
||||||
done(null, obj);
|
done(null, obj);
|
||||||
});
|
});
|
||||||
|
|
||||||
//import models
|
//import models
|
||||||
const Banned = require('../models/site-ban');
|
const Banned = require('../models/site-ban');
|
||||||
const bots = require('../models/bot');
|
const bots = require('../models/bot');
|
||||||
|
const server = require('../models/server');
|
||||||
// set up session
|
|
||||||
app.use(session({
|
|
||||||
store: new MemoryStore({ checkPeriod: 86400000 }),
|
|
||||||
secret: "#YoourrFunnySecretShouldBeLongerThanThisOrdasfjkadsnkfanslkfjasnfdsajnfkdjn#",
|
|
||||||
resave: false,
|
|
||||||
saveUninitialized: false,
|
|
||||||
}));
|
|
||||||
app.use(bodyParser.json());
|
|
||||||
app.use(bodyParser.urlencoded({ extended: true }));
|
|
||||||
app.use(passport.initialize());
|
|
||||||
app.use(passport.session());
|
|
||||||
// set up view engine
|
|
||||||
app.set('view engine', 'ejs');
|
|
||||||
app.set('views', path.join(__dirname, '/views'));
|
|
||||||
// set up static files
|
|
||||||
app.use(express.static(path.join(__dirname, 'public')));
|
|
||||||
// Import routers
|
|
||||||
app.use('/bot', bot);
|
|
||||||
app.use('/admin', admin);
|
|
||||||
app.use('/auth', auth);
|
|
||||||
|
|
||||||
var scopes = ['identify', 'email', 'guilds', 'guilds.join'];
|
var scopes = ['identify', 'email', 'guilds', 'guilds.join'];
|
||||||
var prompt = 'consent'
|
var prompt = 'consent'
|
||||||
|
|
||||||
passport.use(new DiscordStrategy({
|
passport.use(new DiscordStrategy({
|
||||||
clientID: '934087523649609768',
|
clientID: '934087523649609768',
|
||||||
clientSecret: 'nPKjKvOCOyyhDaQM64qcJYbd6CdhCxLh',
|
clientSecret: 'nPKjKvOCOyyhDaQM64qcJYbd6CdhCxLh',
|
||||||
@@ -70,53 +48,92 @@ passport.use(new DiscordStrategy({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
// set up session
|
||||||
|
app.use(session({
|
||||||
|
store: new MemoryStore({ checkPeriod: 86400000 }),
|
||||||
|
secret: "#@%#&^$^$%@$^$&%#$%@#$%$^%&$%^#$%@#$%#E%#%@$FEErfgr3g#%GT%536c53cc6%5%tv%4y4hrgrggrgrgf4n",
|
||||||
|
resave: false,
|
||||||
|
saveUninitialized: false,
|
||||||
|
}));
|
||||||
|
app.use(passport.initialize());
|
||||||
|
app.use(passport.session());
|
||||||
|
app.use(bodyParser.json());
|
||||||
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
// set up view engine
|
||||||
|
app.set('view engine', 'ejs');
|
||||||
|
app.set('views', path.join(__dirname, '/views'));
|
||||||
|
// set up static files
|
||||||
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
|
// Import routers
|
||||||
|
app.use('/bot', bot);
|
||||||
|
app.use('/admin', admin);
|
||||||
|
app.use('/auth', auth);
|
||||||
|
app.use('/server', servers);
|
||||||
|
|
||||||
// set up routes
|
// set up routes
|
||||||
app.get('/',async (req, res) => {
|
app.get('/', async (req, res) => {
|
||||||
var message = req.session.message;
|
var message = req.session.message;
|
||||||
req.session.message = null;
|
req.session.message = null;
|
||||||
var error = req.session.error;
|
var error = req.session.error;
|
||||||
req.session.error = null;
|
req.session.error = null;
|
||||||
var robots = await bots.find({verified: true});
|
var robots = await bots.find({});
|
||||||
|
var servers = await server.find({})
|
||||||
if (message) {
|
if (message) {
|
||||||
res.render('index', {
|
res.render('index', {
|
||||||
message: message,
|
message: message,
|
||||||
user: req.user,
|
user: req.user,
|
||||||
markdown: converter,
|
|
||||||
bots: robots,
|
bots: robots,
|
||||||
|
botscord: client,
|
||||||
|
servers: servers
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(error){
|
else if (error) {
|
||||||
res.render('index', {
|
res.render('index', {
|
||||||
error: error,
|
error: error,
|
||||||
user: req.user,
|
user: req.user,
|
||||||
markdown: converter,
|
|
||||||
bots: robots,
|
bots: robots,
|
||||||
|
botscord: client,
|
||||||
|
servers: servers
|
||||||
|
|
||||||
});
|
});
|
||||||
}else{
|
return
|
||||||
res.render('index.ejs',{
|
} else {
|
||||||
|
res.render('index.ejs', {
|
||||||
user: req.user,
|
user: req.user,
|
||||||
markdown: converter,
|
|
||||||
bots: robots,
|
bots: robots,
|
||||||
|
botscord: client,
|
||||||
|
servers: servers
|
||||||
});
|
});
|
||||||
|
return
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/robots.txt", function (req, res) {
|
app.get("/robots.txt", function (req, res) {
|
||||||
res.set('Content-Type', 'text/plain');
|
res.set('Content-Type', 'text/plain');
|
||||||
res.send(`Sitemap: https://botscord.site/sitemap.xml`);
|
res.send(`Sitemap: https://botscord.xyz/sitemap.xml`);
|
||||||
});
|
});
|
||||||
app.get("/sitemap.xml", async function (req, res) {
|
app.get("/sitemap.xml", async function (req, res) {
|
||||||
let link = "<url><loc>https://botscord.site/</loc></url>";
|
let link = "<url><loc>https://botscord.xyz/</loc></url>";
|
||||||
let botdataforxml = await botsdata.find()
|
let botdataforxml = await bots.find()
|
||||||
botdataforxml.forEach(bot => {
|
botdataforxml.forEach(bot => {
|
||||||
link += "\n<url><loc>https://botscord.site/bot/" + bot.botID + "</loc></url>";
|
link += "\n<url><loc>https://botscord.xyz/bot/" + bot.id + "</loc></url>";
|
||||||
})
|
})
|
||||||
res.set('Content-Type', 'text/xml');
|
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>`);
|
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>`);
|
||||||
});
|
});
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
if (res.statusCode === 404) {
|
||||||
|
req.session.error = "Page not found";
|
||||||
|
res.redirect('/');
|
||||||
|
} else if (res.statusCode === 500) {
|
||||||
|
req.session.error = "Internal server error";
|
||||||
|
res.redirect('/');
|
||||||
|
}else{
|
||||||
|
req.session.error = "Page not found";
|
||||||
|
res.redirect('/');
|
||||||
|
}
|
||||||
|
})
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
console.log('Your app is listening on port ' + port);
|
console.log('Your app is listening on port ' + port);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -558,6 +558,9 @@ video {
|
|||||||
.visible {
|
.visible {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
.invisible {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
.static {
|
.static {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
@@ -598,6 +601,12 @@ video {
|
|||||||
.-z-10 {
|
.-z-10 {
|
||||||
z-index: -10;
|
z-index: -10;
|
||||||
}
|
}
|
||||||
|
.z-10 {
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
.z-30 {
|
||||||
|
z-index: 30;
|
||||||
|
}
|
||||||
.order-3 {
|
.order-3 {
|
||||||
order: 3;
|
order: 3;
|
||||||
}
|
}
|
||||||
@@ -672,6 +681,9 @@ video {
|
|||||||
.-mr-1 {
|
.-mr-1 {
|
||||||
margin-right: -0.25rem;
|
margin-right: -0.25rem;
|
||||||
}
|
}
|
||||||
|
.-mt-1 {
|
||||||
|
margin-top: -0.25rem;
|
||||||
|
}
|
||||||
.block {
|
.block {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -734,6 +746,12 @@ video {
|
|||||||
.h-screen {
|
.h-screen {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
.h-16 {
|
||||||
|
height: 4rem;
|
||||||
|
}
|
||||||
|
.min-h-screen {
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
.w-full {
|
.w-full {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -778,6 +796,12 @@ video {
|
|||||||
.w-56 {
|
.w-56 {
|
||||||
width: 14rem;
|
width: 14rem;
|
||||||
}
|
}
|
||||||
|
.w-32 {
|
||||||
|
width: 8rem;
|
||||||
|
}
|
||||||
|
.w-16 {
|
||||||
|
width: 4rem;
|
||||||
|
}
|
||||||
.w-3\/6 {
|
.w-3\/6 {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
@@ -834,6 +858,22 @@ video {
|
|||||||
--tw-translate-y: 0px;
|
--tw-translate-y: 0px;
|
||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
}
|
}
|
||||||
|
.-translate-x-1 {
|
||||||
|
--tw-translate-x: -0.25rem;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
.-translate-y-full {
|
||||||
|
--tw-translate-y: -100%;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
.-translate-x-12 {
|
||||||
|
--tw-translate-x: -3rem;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
.-translate-y-3 {
|
||||||
|
--tw-translate-y: -0.75rem;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
.scale-75 {
|
.scale-75 {
|
||||||
--tw-scale-x: .75;
|
--tw-scale-x: .75;
|
||||||
--tw-scale-y: .75;
|
--tw-scale-y: .75;
|
||||||
@@ -852,6 +892,9 @@ video {
|
|||||||
.transform {
|
.transform {
|
||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
}
|
}
|
||||||
|
.cursor-pointer {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
.resize {
|
.resize {
|
||||||
resize: both;
|
resize: both;
|
||||||
}
|
}
|
||||||
@@ -1117,6 +1160,18 @@ video {
|
|||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(209 213 219 / var(--tw-bg-opacity));
|
background-color: rgb(209 213 219 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
.bg-gray-900 {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(17 24 39 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
.bg-indigo-500 {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(99 102 241 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
.bg-orange-500 {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(249 115 22 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
.bg-fixed {
|
.bg-fixed {
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
}
|
}
|
||||||
@@ -1126,6 +1181,17 @@ video {
|
|||||||
.fill-current {
|
.fill-current {
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
}
|
}
|
||||||
|
.stroke-current {
|
||||||
|
stroke: currentColor;
|
||||||
|
}
|
||||||
|
.object-cover {
|
||||||
|
-o-object-fit: cover;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
.object-center {
|
||||||
|
-o-object-position: center;
|
||||||
|
object-position: center;
|
||||||
|
}
|
||||||
.p-6 {
|
.p-6 {
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
}
|
}
|
||||||
@@ -1357,6 +1423,10 @@ video {
|
|||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(59 130 246 / var(--tw-text-opacity));
|
color: rgb(59 130 246 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
|
.text-orange-500 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(249 115 22 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
.underline {
|
.underline {
|
||||||
-webkit-text-decoration-line: underline;
|
-webkit-text-decoration-line: underline;
|
||||||
text-decoration-line: underline;
|
text-decoration-line: underline;
|
||||||
@@ -1400,6 +1470,11 @@ video {
|
|||||||
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
|
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
|
||||||
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
||||||
}
|
}
|
||||||
|
.shadow {
|
||||||
|
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
||||||
|
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
||||||
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
||||||
|
}
|
||||||
.shadow-white {
|
.shadow-white {
|
||||||
--tw-shadow-color: #fff;
|
--tw-shadow-color: #fff;
|
||||||
--tw-shadow: var(--tw-shadow-colored);
|
--tw-shadow: var(--tw-shadow-colored);
|
||||||
@@ -1462,6 +1537,11 @@ video {
|
|||||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
transition-duration: 150ms;
|
transition-duration: 150ms;
|
||||||
}
|
}
|
||||||
|
.transition-opacity {
|
||||||
|
transition-property: opacity;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
}
|
||||||
.duration-300 {
|
.duration-300 {
|
||||||
transition-duration: 300ms;
|
transition-duration: 300ms;
|
||||||
}
|
}
|
||||||
@@ -1471,6 +1551,9 @@ video {
|
|||||||
.duration-75 {
|
.duration-75 {
|
||||||
transition-duration: 75ms;
|
transition-duration: 75ms;
|
||||||
}
|
}
|
||||||
|
.duration-150 {
|
||||||
|
transition-duration: 150ms;
|
||||||
|
}
|
||||||
.ease-in-out {
|
.ease-in-out {
|
||||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
}
|
}
|
||||||
@@ -1571,10 +1654,6 @@ body {
|
|||||||
--tooltip-text: #fff;
|
--tooltip-text: #fff;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
.empty\:hidden:empty {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hover\:border-transparent:hover {
|
.hover\:border-transparent:hover {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
@@ -1593,11 +1672,6 @@ body {
|
|||||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
.hover\:bg-gray-400:hover {
|
|
||||||
--tw-bg-opacity: 1;
|
|
||||||
background-color: rgb(156 163 175 / var(--tw-bg-opacity));
|
|
||||||
}
|
|
||||||
|
|
||||||
.hover\:text-gray-900:hover {
|
.hover\:text-gray-900:hover {
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(17 24 39 / var(--tw-text-opacity));
|
color: rgb(17 24 39 / var(--tw-text-opacity));
|
||||||
@@ -1727,16 +1801,16 @@ body {
|
|||||||
background-color: 5865F2;
|
background-color: 5865F2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark\:bg-blue-600 {
|
|
||||||
--tw-bg-opacity: 1;
|
|
||||||
background-color: rgb(37 99 235 / var(--tw-bg-opacity));
|
|
||||||
}
|
|
||||||
|
|
||||||
.dark\:bg-gray-700 {
|
.dark\:bg-gray-700 {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dark\:bg-blue-600 {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(37 99 235 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
.dark\:text-primary-color {
|
.dark\:text-primary-color {
|
||||||
color: #1E2023;;
|
color: #1E2023;;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,20 @@
|
|||||||
var express = require('express'),
|
var express = require('express');
|
||||||
router = express.Router();
|
var index = require('./../../../index');
|
||||||
|
var router = express.Router();
|
||||||
|
|
||||||
router.get('/', function () {
|
router.get('/', function (req, res) {
|
||||||
|
if (req.user) {
|
||||||
|
if (index.config.users.verificator.includes(req.user.userid) || index.config.users.owner.includes(req.user.userid)) {
|
||||||
|
res.render('admin/index', {
|
||||||
|
title: 'Admin',
|
||||||
|
user: req.user
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
res.redirect('/');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res.redirect('/auth?r=' + req.originalUrl);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
@@ -1,11 +1,39 @@
|
|||||||
var express = require('express'),
|
var express = require('express'),
|
||||||
router = express.Router(),
|
router = express.Router(),
|
||||||
passport = require('passport');
|
passport = require('passport');
|
||||||
|
const request = require('request');
|
||||||
|
|
||||||
const client = require('../../../index');
|
const client = require('../../../index');
|
||||||
router.get('/', passport.authenticate('discord'));
|
router.get("/", (req, res, next) => {
|
||||||
|
if (req.session.backURL) {
|
||||||
|
req.session.backURL = req.session.backURL;
|
||||||
|
} else if (req.headers.referer) {
|
||||||
|
const parsed = url.parse(req.headers.referer);
|
||||||
|
if (parsed.hostname === app.locals.domain) {
|
||||||
|
req.session.backURL = parsed.path;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
req.session.backURL = "/";
|
||||||
|
}
|
||||||
|
console.log(req.session)
|
||||||
|
next();
|
||||||
|
}, passport.authenticate('discord'))
|
||||||
router.get('/callback', passport.authenticate('discord', {
|
router.get('/callback', passport.authenticate('discord', {
|
||||||
failureRedirect: '/'
|
failureRedirect: '/'
|
||||||
}), function (req, res) {
|
}), function (req, res) {
|
||||||
|
console.log(req.session)
|
||||||
|
try {
|
||||||
|
request({
|
||||||
|
url: `https://discordapp.com/api/v8/guilds/${config.server.id}/members/${req.user.id}`,
|
||||||
|
method: "PUT",
|
||||||
|
json: {
|
||||||
|
access_token: req.user.accessToken
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bot ${client.token}`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch { };
|
||||||
const embed = new client.embed()
|
const embed = new client.embed()
|
||||||
.setTitle('User logged in')
|
.setTitle('User logged in')
|
||||||
.setDescription(`${req.user.username}#${req.user.discriminator} logged in\nID: ${req.user.id}\nEmail: ${req.user.email}`)
|
.setDescription(`${req.user.username}#${req.user.discriminator} logged in\nID: ${req.user.id}\nEmail: ${req.user.email}`)
|
||||||
@@ -14,13 +42,14 @@ router.get('/callback', passport.authenticate('discord', {
|
|||||||
.setThumbnail("https://cdn.discordapp.com/avatars/" + req.user.id + "/" + req.user.avatar + ".png")
|
.setThumbnail("https://cdn.discordapp.com/avatars/" + req.user.id + "/" + req.user.avatar + ".png")
|
||||||
.setFooter({ text: 'Logged in', iconURL: "https://cdn.discordapp.com/avatars/" + req.user.id + "/" + req.user.avatar + ".png" });
|
.setFooter({ text: 'Logged in', iconURL: "https://cdn.discordapp.com/avatars/" + req.user.id + "/" + req.user.avatar + ".png" });
|
||||||
client.client.channels.cache.get(client.client.config.bot.channels.login).send({ embeds: [embed] });
|
client.client.channels.cache.get(client.client.config.bot.channels.login).send({ embeds: [embed] });
|
||||||
res.redirect('/');
|
console.log(req.session)
|
||||||
|
res.redirect(req.session.backURL || '/')
|
||||||
});
|
});
|
||||||
router.get('/logout', function (req, res) {
|
router.get('/logout', function (req, res) {
|
||||||
req.logout(function (err) {
|
req.logout(function (err) {
|
||||||
if (err) { return next(err); }
|
if (err) { return next(err); }
|
||||||
req.session.message = 'You have been logged out';
|
|
||||||
req.session.destroy();
|
req.session.destroy();
|
||||||
|
req.session.message = 'You have been logged out';
|
||||||
res.redirect('/');
|
res.redirect('/');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ router.get('/add', function (req, res) {
|
|||||||
res.render('bot/add', {user: req.user});
|
res.render('bot/add', {user: req.user});
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
req.session.backURL = req.url;
|
||||||
res.redirect('/auth');
|
res.redirect('/auth');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -38,8 +39,8 @@ router.post('/add', function (req, res) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else {
|
}else {
|
||||||
req.session.error = "You aren't logged in";
|
req.session.backURL = req.url;
|
||||||
res.redirect('/');
|
res.redirect('/auth');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -53,7 +54,8 @@ router.get('/:botID', function (req, res) {
|
|||||||
req.session.error = "No bot found";
|
req.session.error = "No bot found";
|
||||||
return res.redirect('/');
|
return res.redirect('/');
|
||||||
}
|
}
|
||||||
res.render('bot/index', { bot: bot });
|
res.render('bot/index', {
|
||||||
|
bot: bot });
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
var express = require('express'),
|
||||||
|
router = express.Router();
|
||||||
|
var servers = require('../../../models/server');
|
||||||
|
const client = require('../../index');
|
||||||
|
router.get('/', function () {
|
||||||
|
})
|
||||||
|
router.get('/add', function (req, res) {
|
||||||
|
console.log(req.headers.referer)
|
||||||
|
if (req.user) {
|
||||||
|
res.render('server/add', {
|
||||||
|
user: req.user,
|
||||||
|
botscord: client,
|
||||||
|
});
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
req.session.backURL = req.url;
|
||||||
|
res.redirect('/auth');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
router.post('/add', function (req, res) {
|
||||||
|
if (req.user) {
|
||||||
|
var bot = new servers({
|
||||||
|
id: req.body.bot_id,
|
||||||
|
name: req.body.bot_name,
|
||||||
|
verified: false,
|
||||||
|
long_description: req.body.bot_description,
|
||||||
|
owner: req.user.userid,
|
||||||
|
style: req.body.style,
|
||||||
|
description: req.body.bot_short,
|
||||||
|
tags: req.body.tags,
|
||||||
|
});
|
||||||
|
|
||||||
|
bot.save(function (err) {
|
||||||
|
if (err) {
|
||||||
|
console.log(err);
|
||||||
|
req.session.error = "Something went wrong";
|
||||||
|
res.redirect('/');
|
||||||
|
} else {
|
||||||
|
req.session.message = "Server added";
|
||||||
|
res.redirect('/');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
req.session.backURL = req.url;
|
||||||
|
res.redirect('/auth');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get('/:botID', function (req, res) {
|
||||||
|
servers.findOne({ id: req.params.botID }, function (err, bot) {
|
||||||
|
if (err) {
|
||||||
|
console.log(err);
|
||||||
|
return res.redirect('/');
|
||||||
|
}
|
||||||
|
if (!bot) {
|
||||||
|
req.session.error = "No bot found";
|
||||||
|
return res.redirect('/');
|
||||||
|
}
|
||||||
|
res.render('server/index', {
|
||||||
|
user: req.user,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
module.exports = router;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
<%- include('../includes/header.ejs', {title: 'Bot' }) %>
|
||||||
@@ -29,7 +29,20 @@
|
|||||||
<div class="text-white text-center">
|
<div class="text-white text-center">
|
||||||
<p>
|
<p>
|
||||||
© 2021 - 2022 BotsCord. All rights reserved. <br>
|
© 2021 - 2022 BotsCord. All rights reserved. <br>
|
||||||
Made with <i class="fas fa-heart text-red-500"></i> by <a href="https://corwin.dev" class="text-blue-400 hover:text-white">Corwin</a>.
|
Made with <i class="fas fa-heart text-red-500"></i> by <a href="https://corwin.dev"
|
||||||
|
class="text-blue-400 hover:text-white">Corwin</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/tw-elements/dist/js/index.min.js"></script>
|
||||||
|
|
||||||
|
<script src="https://unpkg.com/@popperjs/core@2.9.1/dist/umd/popper.min.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var tooltipTriggerList = [].slice.call(
|
||||||
|
document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
||||||
|
);
|
||||||
|
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||||
|
return new Tooltip(tooltipTriggerEl);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -5,14 +5,14 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=, initial-scale=1.0">
|
<meta name="viewport" content="width=, initial-scale=1.0">
|
||||||
<title>BotsCord |
|
<title>BotsCord |
|
||||||
<% if (typeof title != "undefined") { %>
|
<% if (typeof title !="undefined" ) { %>
|
||||||
<%= title %>
|
<%= title %>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
Home
|
Home
|
||||||
<% } %>
|
<% } %>
|
||||||
</title>
|
</title>
|
||||||
<link href="/css/style.css" rel="stylesheet">
|
<link href="/css/style.css" rel="stylesheet">
|
||||||
<link href=https://pro.fontawesome.com/releases/v5.13.1/css/all.css rel=stylesheet>
|
<script src="https://kit.fontawesome.com/204113bb1b.js" crossorigin="anonymous"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-primary-color">
|
<body class="bg-primary-color">
|
||||||
@@ -25,78 +25,100 @@
|
|||||||
<img class="mx-auto w-auto h-8" src="/img/logo.png" alt="logo">
|
<img class="mx-auto w-auto h-8" src="/img/logo.png" alt="logo">
|
||||||
</a>
|
</a>
|
||||||
<a href="/" class="font-semibold text-xl tracking-tight"> BotsCord</a>
|
<a href="/" class="font-semibold text-xl tracking-tight"> BotsCord</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<button data-collapse-toggle="navbar-solid-bg" type="button" class="inline-flex justify-end items-end ml-3 text-gray-400 rounded-lg lg:hidden hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:text-gray-400 dark:hover:text-white dark:focus:ring-gray-500" aria-controls="navbar-solid-bg" aria-expanded="false" id="trigger">
|
<button data-collapse-toggle="navbar-solid-bg" type="button"
|
||||||
|
class="inline-flex justify-end items-end ml-3 text-gray-400 rounded-lg lg:hidden hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:text-gray-400 dark:hover:text-white dark:focus:ring-gray-500"
|
||||||
|
aria-controls="navbar-solid-bg" aria-expanded="false" id="trigger">
|
||||||
<span class="sr-only">Open main menu</span>
|
<span class="sr-only">Open main menu</span>
|
||||||
<svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
<svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20"
|
||||||
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path>
|
xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
||||||
|
clip-rule="evenodd"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<div class="w-full hidden lg:block flex-grow lg:items-center lg:w-auto content-center items-center" id="navbar-solid-bg">
|
<div class="w-full hidden lg:block flex-grow lg:items-center lg:w-auto content-center items-center"
|
||||||
|
id="navbar-solid-bg">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="text-sm lg:flex-grow">
|
<div class="text-sm lg:flex-grow">
|
||||||
<a href="/bots" class="block lg:inline-block lg:mt-0 text-white hover:text-white mr-4 text-lg">
|
<a href="/bots" class="block lg:inline-block lg:mt-0 text-white hover:text-white mr-4 text-lg">
|
||||||
<li class="fad fa-robot mr-1"></li>
|
<li class="fa fa-robot mr-1"></li>
|
||||||
Bots
|
Bots
|
||||||
</a>
|
</a>
|
||||||
<a href="/servers" class="block lg:inline-block lg:mt-0 text-white hover:text-white mr-4 text-lg">
|
<a href="/servers" class="block lg:inline-block lg:mt-0 text-white hover:text-white mr-4 text-lg">
|
||||||
<li class="fad fa-server mr-1"></li>
|
<li class="fa fa-server mr-1"></li>
|
||||||
Servers
|
Servers
|
||||||
</a>
|
</a>
|
||||||
<div class="relative inline-block text-left">
|
<div class="relative inline-block text-left">
|
||||||
<div>
|
<div>
|
||||||
<button type="button" class="block lg:inline-block lg:mt-0 text-white hover:text-white mr-4 text-lg" id="menu-button" aria-expanded="true" aria-haspopup="true">
|
<button type="button" class="block lg:inline-block lg:mt-0 text-white hover:text-white mr-4 text-lg"
|
||||||
|
id="menu-button" aria-expanded="true" aria-haspopup="true">
|
||||||
More
|
More
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden origin-top-right absolute right-0 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" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1">
|
<div
|
||||||
|
class="hidden origin-top-right absolute right-0 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"
|
||||||
|
role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1">
|
||||||
<div class="py-1" role="none">
|
<div class="py-1" role="none">
|
||||||
<!-- Active: "bg-gray-100 text-gray-900", Not Active: "text-gray-700" -->
|
<!-- Active: "bg-gray-100 text-gray-900", Not Active: "text-gray-700" -->
|
||||||
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-0">Edit</a>
|
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"
|
||||||
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-1">Duplicate</a>
|
id="menu-item-0">Edit</a>
|
||||||
|
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"
|
||||||
|
id="menu-item-1">Duplicate</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-1" role="none">
|
<div class="py-1" role="none">
|
||||||
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-2">Archive</a>
|
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"
|
||||||
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-3">Move</a>
|
id="menu-item-2">Archive</a>
|
||||||
|
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"
|
||||||
|
id="menu-item-3">Move</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-1" role="none">
|
<div class="py-1" role="none">
|
||||||
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-4">Share</a>
|
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"
|
||||||
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-5">Add to favorites</a>
|
id="menu-item-4">Share</a>
|
||||||
|
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"
|
||||||
|
id="menu-item-5">Add to favorites</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-1" role="none">
|
<div class="py-1" role="none">
|
||||||
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="menu-item-6">Delete</a>
|
<a href="#" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"
|
||||||
|
id="menu-item-6">Delete</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- dropdown menu with tailwindcss -->
|
<!-- dropdown menu with tailwindcss -->
|
||||||
</div>
|
</div>
|
||||||
<% if (typeof user == "undefined") { %>
|
<% if (typeof user=="undefined" ) { %>
|
||||||
<a href="/auth" class="inline-block text-sm px-4 py-2 leading-none border rounded text-white border-white hover:border-transparent hover:text-blue-color hover:bg-white mt-4 lg:mt-0">Login</a>
|
<a href="/auth"
|
||||||
<% }else { %>
|
class="inline-block text-sm px-4 py-2 leading-none border rounded text-white border-white hover:border-transparent hover:text-blue-color hover:bg-white mt-4 lg:mt-0">Login</a>
|
||||||
<a href="/profile" class="inline-block text-sm px-4 py-2 leading-none border rounded text-white border-white hover:border-transparent hover:text-blue-color hover:bg-white mt-4 lg:mt-0">Profile</a>
|
<% }else { %>
|
||||||
<a href="/auth/logout" class="inline-block text-sm px-4 py-2 leading-none border rounded text-white border-red-500 hover:border-transparent hover:text-blue-color hover:bg-white mt-4 lg:mt-0">Logout</a>
|
<a href="/profile"
|
||||||
<% } %>
|
class="inline-block text-sm px-4 py-2 leading-none border rounded text-white border-white hover:border-transparent hover:text-blue-color hover:bg-white mt-4 lg:mt-0">Profile</a>
|
||||||
|
<a href="/auth/logout"
|
||||||
|
class="inline-block text-sm px-4 py-2 leading-none border rounded text-white border-red-500 hover:border-transparent hover:text-blue-color hover:bg-white mt-4 lg:mt-0">Logout</a>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<% if (typeof error != "undefined") { %>
|
<% if (typeof error !="undefined" ) { %>
|
||||||
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
|
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
|
||||||
<strong class="font-bold">Holy Cows!</strong>
|
<strong class="font-bold">Holy Cows!</strong>
|
||||||
<span class="block sm:inline"><br><%= error %></span>
|
<span class="block sm:inline"><br>
|
||||||
</div>
|
<%= error %>
|
||||||
<% } %>
|
</span>
|
||||||
<% if (typeof message != "undefined") { %>
|
</div>
|
||||||
<div class="bg-white border border-blue-400 text-blue-700 px-4 py-3 rounded relative" role="alert">
|
<% } %>
|
||||||
<strong class="font-bold">Alert!</strong>
|
<% if (typeof message !="undefined" ) { %>
|
||||||
<span class="block sm:inline"><br><%= message %></span>
|
<div class="bg-white border border-blue-400 text-blue-700 px-4 py-3 rounded relative" role="alert">
|
||||||
</div>
|
<strong class="font-bold">Alert!</strong>
|
||||||
<% } %>
|
<span class="block sm:inline"><br>
|
||||||
|
<%= message %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
const targetEl = document.getElementById("navbar-solid-bg");
|
const targetEl = document.getElementById("navbar-solid-bg");
|
||||||
const triggerEl = document.getElementById("trigger");
|
const triggerEl = document.getElementById("trigger");
|
||||||
triggerEl.addEventListener("click", function() {
|
triggerEl.addEventListener("click", function () {
|
||||||
if (targetEl.classList.contains("hidden")) {
|
if (targetEl.classList.contains("hidden")) {
|
||||||
targetEl.classList.remove("hidden");
|
targetEl.classList.remove("hidden");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+235
-59
@@ -1,64 +1,240 @@
|
|||||||
<%- include("./includes/header.ejs", { user:user }) %>
|
<%- 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="container-sm mx-auto px-3 mb-5 mt-1 h-fit p-1">
|
||||||
<div class="mb-3 mx-auto h-fit">
|
<div class="mb-3 mx-auto h-fit">
|
||||||
<span style="float: right; margin-right: 10%;" class="logo">
|
<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"
|
||||||
</span>
|
alt="Discord Bots | Discord Bot List">
|
||||||
<br><br>
|
</span>
|
||||||
<h1 class="text-xl" style="font-weight:800;color:#fff">BotsCord</h1>
|
<br><br>
|
||||||
<p class="content" style="opacity:.6;color:#fff">Find the best Discord Bots for your server with BotsCord!</p>
|
<h1 class="text-xl" style="font-weight:800;color:#fff">BotsCord</h1>
|
||||||
<br>
|
<p class="content" style="opacity:.6;color:#fff">Find the best Discord Bots for your server with BotsCord!</p>
|
||||||
<form class="flex items-center ">
|
<br>
|
||||||
<label for="simple-search" class="sr-only">Search</label>
|
<form class="flex items-center ">
|
||||||
<div class="relative w-3/6">
|
<label for="simple-search" class="sr-only">Search</label>
|
||||||
<div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
|
<div class="relative w-3/6">
|
||||||
<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">
|
<div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
|
||||||
<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"
|
||||||
</svg>
|
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>
|
||||||
</div>
|
</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>
|
<button type="submit"
|
||||||
</div>
|
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"
|
||||||
<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%">
|
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">
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"
|
||||||
<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>
|
xmlns="http://www.w3.org/2000/svg">
|
||||||
</svg>
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
<span class="sr-only">Search</span>
|
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
||||||
</button>
|
</svg>
|
||||||
</form>
|
<span class="sr-only">Search</span>
|
||||||
|
</button>
|
||||||
<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="fad fa-magic"></i> Moderation</a>
|
</form>
|
||||||
<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="fad fa-smile"></i> Fun</a>
|
<a title="BotsCord" href="/tag/Moderation"
|
||||||
<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="fad fa-file"></i> Logging</a>
|
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
|
||||||
<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="fad fa-cogs"></i> Utility</a>
|
class="fa fa-magic"></i> Moderation</a>
|
||||||
<br><br><br><br>
|
<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>
|
||||||
|
<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> Utility</a>
|
||||||
|
<br><br><br><br>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- bots section -->
|
||||||
<div class="mx-auto text-center">
|
<div class="promotedbots">
|
||||||
<br>
|
<% var nbots=bots.filter(a=> a.promoted == true)
|
||||||
<h2 class="text-xl text-white text-center"><i class="fa fa-bullhorn" aria-hidden="true"></i> Promoted Bots</h2>
|
nbots.forEach((val, key) => {
|
||||||
<p class="content text-white text-center" style="opacity:.6">These bots are featured on BotsCord!</p>
|
randomIndex = Math.ceil(Math.random()*(key + 1));
|
||||||
</div>
|
nbots[key] = nbots[randomIndex];
|
||||||
<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-4 xl:grid-cols-5 m-8">
|
nbots[randomIndex] = val;
|
||||||
<% bots.slice(-5).forEach(bot=>{ %>
|
});
|
||||||
<% if(bot.premium == true) { %>
|
if(nbots.length > 0) { %>
|
||||||
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
|
<div class="mx-auto text-center">
|
||||||
<img class="w-full rounded-full" src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp" alt="<%= bot.name %>">
|
<br>
|
||||||
<div class="px-6 py-4">
|
<h2 class="text-xl text-white text-center"><i class="fa fa-bullhorn" aria-hidden="true"></i> Promoted Bots
|
||||||
<div class="font-bold text-xl mb-2 text-white"><%= bot.name %></div>
|
</h2>
|
||||||
<p class="text-white text-base"><%= bot.description %>
|
<p class="content text-white text-center" style="opacity:.6">These bots are featured on BotsCord!</p>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
<div
|
||||||
<% if(bot.tags) {%>
|
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-4 xl:grid-cols-5 m-8">
|
||||||
<div class="px-6 pt-4 pb-2">
|
<% } %>
|
||||||
<% bot.tags.forEach(tag=>{ %>
|
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
|
||||||
<span class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %></span>
|
<div
|
||||||
<% }) %>
|
class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
|
||||||
</div>
|
<img class="w-full rounded-full"
|
||||||
<% } %>
|
src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp"
|
||||||
<% } %>
|
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>
|
||||||
|
<% if(bot.tags) {%>
|
||||||
|
<div class="px-6 pt-4 pb-2">
|
||||||
|
<% bot.tags.forEach(tag=>{ %>
|
||||||
|
<span
|
||||||
|
class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
|
||||||
|
<%= tag %>
|
||||||
|
</span>
|
||||||
|
<% }) %>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% }) %>
|
<div class="randombots">
|
||||||
</div>
|
<% var nbots=bots.filter(a=> a.verified == true)
|
||||||
<%- include("./includes/footer.ejs") %>
|
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-4 xl: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">
|
||||||
|
<div class="font-bold text-xl mb-2 text-white">
|
||||||
|
<%= bot.name %>
|
||||||
|
</div>
|
||||||
|
<p class="text-white text-base">
|
||||||
|
<%= bot.description %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<% if(bot.tags) {%>
|
||||||
|
<div class="px-6 pt-4 pb-2">
|
||||||
|
<% bot.tags.forEach(tag=>{ %>
|
||||||
|
<span
|
||||||
|
class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
|
||||||
|
<%= tag %>
|
||||||
|
</span>
|
||||||
|
<% }) %>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
<% } } %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- server section -->
|
||||||
|
<div class="promotedservers">
|
||||||
|
<% var nbots=servers.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 Servers
|
||||||
|
</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-4 xl: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">
|
||||||
|
<div class="font-bold text-xl mb-2 text-white">
|
||||||
|
<%= bot.name %>
|
||||||
|
</div>
|
||||||
|
<p class="text-white text-base">
|
||||||
|
<%= bot.description %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<% if(bot.tags) {%>
|
||||||
|
<div class="px-6 pt-4 pb-2">
|
||||||
|
<% bot.tags.forEach(tag=>{ %>
|
||||||
|
<span
|
||||||
|
class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
|
||||||
|
<%= tag %>
|
||||||
|
</span>
|
||||||
|
<% }) %>
|
||||||
|
</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 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-4 xl: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">
|
||||||
|
<div class="font-bold text-xl mb-2 text-white">
|
||||||
|
<%= bot.name %>
|
||||||
|
</div>
|
||||||
|
<p class="text-white text-base">
|
||||||
|
<%= bot.description %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<% if(bot.tags) {%>
|
||||||
|
<div class="px-6 pt-4 pb-2">
|
||||||
|
<% bot.tags.forEach(tag=>{ %>
|
||||||
|
<span
|
||||||
|
class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#
|
||||||
|
<%= tag %>
|
||||||
|
</span>
|
||||||
|
<% }) %>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%- include("./includes/footer.ejs") %>
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<!-- add servers for the website -->
|
||||||
|
<%- include('../includes/header.ejs', {title: 'Add server' }) %>
|
||||||
|
<!-- 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="server"
|
||||||
|
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++) { %>
|
||||||
|
<% console.log(user.guilds[i].name) %>
|
||||||
|
<option value="<%= user.guilds[i].id %>">
|
||||||
|
<%= user.guilds[i].name %>
|
||||||
|
</option>
|
||||||
|
<% } %>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="relative z-0 mb-6 w-full group">
|
||||||
|
<input type="text" name="server_id" 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>
|
||||||
|
</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
|
||||||
|
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 />
|
||||||
|
<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>
|
||||||
|
<!-- select buttons for html/markdown -->
|
||||||
|
<div class="relative z-0 mb-6 w-full group">
|
||||||
|
<select name="style"
|
||||||
|
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="html">HTML</option>
|
||||||
|
<option value="markdown">MarkDown</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>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
<%- include('../includes/header.ejs', {title: 'Bot' }) %>
|
||||||
Reference in new issue
Block a user