Added some bots commands
This commit is contained in:
1 parent
a3e6692d7b
commit
4d7c164059
18 files changed
+505
-89
No files matched your search
@@ -7,6 +7,7 @@ module.exports = {
|
||||
"login": "868065455628234780",
|
||||
"vote": "937643610541793300",
|
||||
"error": "1003947531543269507",
|
||||
"info": "1005178285124239510",
|
||||
},
|
||||
"bsl" : {
|
||||
"id": "870001234583621713",
|
||||
@@ -18,6 +19,10 @@ module.exports = {
|
||||
"invite":"https://discord.com/api/oauth2/authorize?client_id=870001234583621713&permissions=314433&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fcallback&response_type=code&scope=applications.commands%20bot"
|
||||
}
|
||||
},
|
||||
"discord":{
|
||||
"id": "868065454940385291",
|
||||
"invite":"",
|
||||
},
|
||||
"server": {
|
||||
"port": 3000,
|
||||
"host": "http://localhost:3000",
|
||||
|
||||
@@ -34,6 +34,7 @@ bsl.config = config
|
||||
client.on('ready', () => {
|
||||
console.log('Website bot is ready!');
|
||||
require('./website')
|
||||
require('./website/bot')
|
||||
});
|
||||
bsl.on('ready', () => {
|
||||
console.log('BSL Started!');
|
||||
@@ -82,4 +83,7 @@ module.exports.config = config;
|
||||
module.exports.mongoose = mongoose;
|
||||
module.exports.client = client;
|
||||
module.exports.bsl = bsl;
|
||||
module.exports.embed = EmbedBuilder;
|
||||
module.exports.embed = EmbedBuilder;
|
||||
global.client = client;
|
||||
global.bsl = bsl;
|
||||
global.config = config;
|
||||
+1
-2
@@ -2,13 +2,12 @@ const mongoose = require("mongoose");
|
||||
let hm = new mongoose.Schema({
|
||||
id: String,
|
||||
name: String,
|
||||
avatar: String,
|
||||
icon: String,
|
||||
verified: Boolean,
|
||||
description: String,
|
||||
owner: String,
|
||||
long_description: String,
|
||||
banner: String,
|
||||
style: String,
|
||||
tags: [String],
|
||||
premium: Boolean,
|
||||
});
|
||||
|
||||
+2
-2
@@ -2,13 +2,13 @@ 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,
|
||||
icon: String,
|
||||
members: String,
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("servers", hm);
|
||||
Generated
+103
-1
@@ -22,7 +22,28 @@
|
||||
"passport-discord": "^0.1.4",
|
||||
"request": "^2.88.2",
|
||||
"showdown": "^2.1.0",
|
||||
"tailwindcss": "^3.1.7"
|
||||
"tailwindcss": "^3.1.7",
|
||||
"url": "^0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"postcss-nesting": "^10.1.10"
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/selector-specificity": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-2.0.2.tgz",
|
||||
"integrity": "sha512-IkpVW/ehM1hWKln4fCA3NzJU8KwD+kIOvPZA4cqxoJHtE21CCzjyp+Kxbu0i5I4tBNOlXPL9mjwnWlL0VEG4Fg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^12 || ^14 || >=16"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/csstools"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.2",
|
||||
"postcss-selector-parser": "^6.0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders": {
|
||||
@@ -1978,6 +1999,26 @@
|
||||
"postcss": "^8.2.14"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-nesting": {
|
||||
"version": "10.1.10",
|
||||
"resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-10.1.10.tgz",
|
||||
"integrity": "sha512-lqd7LXCq0gWc0wKXtoKDru5wEUNjm3OryLVNRZ8OnW8km6fSNUuFrjEhU3nklxXE2jvd4qrox566acgh+xQt8w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@csstools/selector-specificity": "^2.0.0",
|
||||
"postcss-selector-parser": "^6.0.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12 || ^14 || >=16"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/csstools"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.2"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-selector-parser": {
|
||||
"version": "6.0.10",
|
||||
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
|
||||
@@ -2039,6 +2080,15 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/querystring": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
|
||||
"integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==",
|
||||
"deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.",
|
||||
"engines": {
|
||||
"node": ">=0.4.x"
|
||||
}
|
||||
},
|
||||
"node_modules/queue-microtask": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
||||
@@ -2673,6 +2723,20 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/url": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
|
||||
"integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==",
|
||||
"dependencies": {
|
||||
"punycode": "1.3.2",
|
||||
"querystring": "0.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/url/node_modules/punycode": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
|
||||
"integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw=="
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
@@ -2779,6 +2843,13 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@csstools/selector-specificity": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-2.0.2.tgz",
|
||||
"integrity": "sha512-IkpVW/ehM1hWKln4fCA3NzJU8KwD+kIOvPZA4cqxoJHtE21CCzjyp+Kxbu0i5I4tBNOlXPL9mjwnWlL0VEG4Fg==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"@discordjs/builders": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.1.0.tgz",
|
||||
@@ -4170,6 +4241,16 @@
|
||||
"postcss-selector-parser": "^6.0.6"
|
||||
}
|
||||
},
|
||||
"postcss-nesting": {
|
||||
"version": "10.1.10",
|
||||
"resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-10.1.10.tgz",
|
||||
"integrity": "sha512-lqd7LXCq0gWc0wKXtoKDru5wEUNjm3OryLVNRZ8OnW8km6fSNUuFrjEhU3nklxXE2jvd4qrox566acgh+xQt8w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@csstools/selector-specificity": "^2.0.0",
|
||||
"postcss-selector-parser": "^6.0.10"
|
||||
}
|
||||
},
|
||||
"postcss-selector-parser": {
|
||||
"version": "6.0.10",
|
||||
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
|
||||
@@ -4216,6 +4297,11 @@
|
||||
"side-channel": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"querystring": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
|
||||
"integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g=="
|
||||
},
|
||||
"queue-microtask": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
||||
@@ -4647,6 +4733,22 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
|
||||
"integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==",
|
||||
"requires": {
|
||||
"punycode": "1.3.2",
|
||||
"querystring": "0.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"punycode": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
|
||||
"integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
|
||||
+5
-1
@@ -39,6 +39,10 @@
|
||||
"passport-discord": "^0.1.4",
|
||||
"request": "^2.88.2",
|
||||
"showdown": "^2.1.0",
|
||||
"tailwindcss": "^3.1.7"
|
||||
"tailwindcss": "^3.1.7",
|
||||
"url": "^0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"postcss-nesting": "^10.1.10"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
const client = require('../../index.js').client;
|
||||
const servers = require('../../models/server');
|
||||
var config = client.config
|
||||
const { SlashCommandBuilder, Routes } = require('discord.js');
|
||||
const { REST } = require('@discordjs/rest');
|
||||
const commands = [
|
||||
new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),
|
||||
new SlashCommandBuilder().setName('topserver').setDescription('Replies with highest server!'),
|
||||
new SlashCommandBuilder().setName('user').setDescription('Replies with user info and connected bots/servers!'),
|
||||
]
|
||||
.map(command => command.toJSON());
|
||||
|
||||
const rest = new REST({ version: '10' }).setToken(config.bot.token);
|
||||
|
||||
rest.put(Routes.applicationGuildCommands(config.bot.id, config.discord.id), { body: commands })
|
||||
.then(() => console.log('Successfully registered application commands.'))
|
||||
.catch(console.error);
|
||||
|
||||
client.on('interactionCreate', async interaction => {
|
||||
if (!interaction.isChatInputCommand()) return;
|
||||
|
||||
const { commandName } = interaction;
|
||||
|
||||
if (commandName === 'ping') {
|
||||
await interaction.reply('Pong!');
|
||||
} else if (commandName === 'topserver') {
|
||||
const topServer = await servers.find({}, { sort: { memberCount: -1 } });
|
||||
await interaction.reply(`The top server is ${topServer.name} with ${topServer.memberCount} members!`);
|
||||
} 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!`);
|
||||
|
||||
}
|
||||
});
|
||||
@@ -595,6 +595,9 @@ video {
|
||||
.top-3 {
|
||||
top: 0.75rem;
|
||||
}
|
||||
.right-1 {
|
||||
right: 0.25rem;
|
||||
}
|
||||
.z-0 {
|
||||
z-index: 0;
|
||||
}
|
||||
@@ -613,12 +616,24 @@ video {
|
||||
.col-auto {
|
||||
grid-column: auto;
|
||||
}
|
||||
.float-right {
|
||||
float: right;
|
||||
}
|
||||
.m-8 {
|
||||
margin: 2rem;
|
||||
}
|
||||
.m-20 {
|
||||
margin: 5rem;
|
||||
}
|
||||
.m-2 {
|
||||
margin: 0.5rem;
|
||||
}
|
||||
.m-4 {
|
||||
margin: 1rem;
|
||||
}
|
||||
.m-10 {
|
||||
margin: 2.5rem;
|
||||
}
|
||||
.mx-auto {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
@@ -627,6 +642,22 @@ video {
|
||||
margin-left: -0.75rem;
|
||||
margin-right: -0.75rem;
|
||||
}
|
||||
.mx-10 {
|
||||
margin-left: 2.5rem;
|
||||
margin-right: 2.5rem;
|
||||
}
|
||||
.mx-96 {
|
||||
margin-left: 24rem;
|
||||
margin-right: 24rem;
|
||||
}
|
||||
.mx-20 {
|
||||
margin-left: 5rem;
|
||||
margin-right: 5rem;
|
||||
}
|
||||
.mx-14 {
|
||||
margin-left: 3.5rem;
|
||||
margin-right: 3.5rem;
|
||||
}
|
||||
.mb-2 {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
@@ -684,6 +715,18 @@ video {
|
||||
.-mt-1 {
|
||||
margin-top: -0.25rem;
|
||||
}
|
||||
.mt-7 {
|
||||
margin-top: 1.75rem;
|
||||
}
|
||||
.ml-4 {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
.mr-5 {
|
||||
margin-right: 1.25rem;
|
||||
}
|
||||
.ml-5 {
|
||||
margin-left: 1.25rem;
|
||||
}
|
||||
.block {
|
||||
display: block;
|
||||
}
|
||||
@@ -752,6 +795,11 @@ video {
|
||||
.min-h-screen {
|
||||
min-height: 100vh;
|
||||
}
|
||||
.min-h-min {
|
||||
min-height: -webkit-min-content;
|
||||
min-height: -moz-min-content;
|
||||
min-height: min-content;
|
||||
}
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -805,6 +853,12 @@ video {
|
||||
.w-3\/6 {
|
||||
width: 50%;
|
||||
}
|
||||
.w-2\/3 {
|
||||
width: 66.666667%;
|
||||
}
|
||||
.w-1\/3 {
|
||||
width: 33.333333%;
|
||||
}
|
||||
.max-w-7xl {
|
||||
max-width: 80rem;
|
||||
}
|
||||
@@ -826,6 +880,9 @@ video {
|
||||
.flex-none {
|
||||
flex: none;
|
||||
}
|
||||
.flex-1 {
|
||||
flex: 1 1 0%;
|
||||
}
|
||||
.flex-shrink-0 {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -898,6 +955,9 @@ video {
|
||||
.resize {
|
||||
resize: both;
|
||||
}
|
||||
.list-disc {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.appearance-none {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
@@ -984,6 +1044,11 @@ video {
|
||||
margin-right: calc(2rem * var(--tw-space-x-reverse));
|
||||
margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
|
||||
}
|
||||
.space-x-4 > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-space-x-reverse: 0;
|
||||
margin-right: calc(1rem * var(--tw-space-x-reverse));
|
||||
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
|
||||
}
|
||||
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-divide-y-reverse: 0;
|
||||
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
||||
@@ -1178,6 +1243,9 @@ video {
|
||||
.bg-right-top {
|
||||
background-position: right top;
|
||||
}
|
||||
.bg-right {
|
||||
background-position: right;
|
||||
}
|
||||
.fill-current {
|
||||
fill: currentColor;
|
||||
}
|
||||
@@ -1299,6 +1367,12 @@ video {
|
||||
.pr-5 {
|
||||
padding-right: 1.25rem;
|
||||
}
|
||||
.pb-0 {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.pt-0 {
|
||||
padding-top: 0px;
|
||||
}
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
@@ -1329,6 +1403,10 @@ video {
|
||||
font-size: 0.75rem;
|
||||
line-height: 1rem;
|
||||
}
|
||||
.text-2xl {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2rem;
|
||||
}
|
||||
.font-bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -1601,7 +1679,10 @@ body {
|
||||
src: url(https://fonts.gstatic.com/s/quicksand/v30/6xK-dSZaM9iE8KbpRA_LJ3z8mH9BOJvgkP8o58a-wg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
|
||||
/* media query for logo to vanish on small screens */
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.logo {
|
||||
display: none;
|
||||
@@ -1885,6 +1966,12 @@ body {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.sm\:min-h-min {
|
||||
min-height: -webkit-min-content;
|
||||
min-height: -moz-min-content;
|
||||
min-height: min-content;
|
||||
}
|
||||
|
||||
.sm\:w-auto {
|
||||
width: auto;
|
||||
}
|
||||
@@ -1923,6 +2010,10 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.lg\:h-5\/6 {
|
||||
height: 83.333333%;
|
||||
}
|
||||
|
||||
.lg\:w-1\/2 {
|
||||
width: 50%;
|
||||
}
|
||||
@@ -1935,8 +2026,8 @@ body {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.lg\:grid-cols-4 {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
.lg\:grid-cols-3 {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.lg\:items-center {
|
||||
@@ -1946,7 +2037,14 @@ body {
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
|
||||
.xl\:grid-cols-5 {
|
||||
.xl\:grid-cols-4 {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1536px) {
|
||||
|
||||
.\32xl\:grid-cols-5 {
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,10 @@ body {
|
||||
src: url(https://fonts.gstatic.com/s/quicksand/v30/6xK-dSZaM9iE8KbpRA_LJ3z8mH9BOJvgkP8o58a-wg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
|
||||
/* media query for logo to vanish on small screens */
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.logo {
|
||||
display: none;
|
||||
|
||||
@@ -2,6 +2,7 @@ var express = require('express'),
|
||||
router = express.Router(),
|
||||
passport = require('passport');
|
||||
const request = require('request');
|
||||
var url = require('url');
|
||||
|
||||
const client = require('../../../index');
|
||||
router.get("/", (req, res, next) => {
|
||||
@@ -9,7 +10,7 @@ router.get("/", (req, res, next) => {
|
||||
req.session.backURL = req.session.backURL;
|
||||
} else if (req.headers.referer) {
|
||||
const parsed = url.parse(req.headers.referer);
|
||||
if (parsed.hostname === app.locals.domain) {
|
||||
if (parsed.hostname === global.config.server.host) {
|
||||
req.session.backURL = parsed.path;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -22,10 +22,8 @@ router.post('/add', function (req, res) {
|
||||
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) {
|
||||
|
||||
@@ -3,6 +3,8 @@ var express = require('express'),
|
||||
var servers = require('../../../models/server');
|
||||
const client = require('../../../index');
|
||||
const Discord = require('discord.js');
|
||||
var showdown = require('showdown'),
|
||||
converter = new showdown.Converter();
|
||||
router.get('/', function () {
|
||||
})
|
||||
|
||||
@@ -11,7 +13,7 @@ router.get('/add', function (req, res) {
|
||||
res.render('server/add', {
|
||||
user: req.user,
|
||||
botscord: client
|
||||
});
|
||||
});
|
||||
return
|
||||
} else {
|
||||
req.session.backURL = req.originalUrl;
|
||||
@@ -24,45 +26,66 @@ router.post('/add', async function (req, res) {
|
||||
var checkServer = await client.bsl.guilds.cache.get(req.body.serverid);
|
||||
if (!checkServer) {
|
||||
return res.redirect(client.config.bot.bsl.invite + "&guild_id=" + req.body.serverid);
|
||||
}else{
|
||||
let checkGuild = await servers.findOne({ id: guildID });
|
||||
} else {
|
||||
let checkGuild = await servers.findOne({ id: checkServer.id });
|
||||
if (checkGuild) {
|
||||
req.session.error = "Server already exists";
|
||||
return res.redirect('/');
|
||||
}
|
||||
|
||||
var server = new servers({
|
||||
id: req.body.serverid,
|
||||
name: checkServer.name,
|
||||
owner: req.user.userid,
|
||||
long_description: req.body.server_description,
|
||||
description: req.body.server_short,
|
||||
icon: checkServer.iconURL({ format: 'png', dynamic: true }),
|
||||
memberCount: checkServer.memberCount,
|
||||
tags: req.body.tags
|
||||
})
|
||||
}
|
||||
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,
|
||||
});
|
||||
var tagss = Array.from(new Set(req.body.tags));
|
||||
var tags;
|
||||
for (let i = 0; i < tagss.length; i++) {
|
||||
if (i === 3) break;
|
||||
if (tagss[i] === null) {
|
||||
return
|
||||
} else {
|
||||
if (tags === undefined) {
|
||||
tags = tagss[i]
|
||||
} else {
|
||||
tags = tags + ", " + tagss[i];
|
||||
}
|
||||
}
|
||||
|
||||
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('/');
|
||||
}
|
||||
});
|
||||
console.log(tags)
|
||||
const embed = new client.embed()
|
||||
.setTitle('New server')
|
||||
.setDescription(`${req.user.username}#${req.user.discriminator} added **${checkServer.name}** with members: **${checkServer.memberCount}**\nDescription: **${req.body.server_short}**\nWith tags: **${tags}**`)
|
||||
.setColor('#00ff00')
|
||||
.setTimestamp()
|
||||
.setThumbnail(checkServer.iconURL({ format: 'png', dynamic: true }))
|
||||
.setFooter({ text: 'New Server', iconURL: "https://cdn.discordapp.com/avatars/" + req.user.id + "/" + req.user.avatar + ".png" });
|
||||
client.client.channels.cache.get(client.client.config.bot.channels.info).send({ embeds: [embed] });
|
||||
server.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.originalUrl;
|
||||
res.redirect('/auth');
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/:botID', function (req, res) {
|
||||
servers.findOne({ id: req.params.botID }, function (err, bot) {
|
||||
router.get('/:server', function (req, res) {
|
||||
servers.findOne({ id: req.params.server }, function (err, bot) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return res.redirect('/');
|
||||
@@ -73,6 +96,8 @@ router.get('/:botID', function (req, res) {
|
||||
}
|
||||
res.render('server/index', {
|
||||
user: req.user,
|
||||
server: bot,
|
||||
serverr: global.client.guilds.cache.get(bot.id)
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
@@ -15,19 +15,13 @@
|
||||
</div>
|
||||
<div class="relative z-0 mb-6 w-full group">
|
||||
<textarea type="text" name="bot_description" id="bot_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="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">Bot Description</label>
|
||||
<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">Bot Description (MarkDown supported!)</label>
|
||||
</div>
|
||||
<div class="relative z-0 mb-6 w-full group">
|
||||
<input type="text" name="bot_short" id="floating_last_name" class="block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer" placeholder=" " required />
|
||||
<label for="bot_name" class="peer-focus:font-medium absolute text-sm text-white dark:text-white duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Short Description (Will be show on home page)</label>
|
||||
</div>
|
||||
<!-- 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>
|
||||
|
||||
<!-- tags -->
|
||||
<div class="relative z-0 mb-6 w-full group">
|
||||
<select multiple name="tag" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required>
|
||||
@@ -38,6 +32,17 @@
|
||||
<option value="game">Game</option>
|
||||
<option value="music">Music</option>
|
||||
<option value="leveling">Leveling</option>
|
||||
<option value="economy">Economy</option>
|
||||
<option value="minecraft">Minecraft</option>
|
||||
<option value="anime">Anime</option>
|
||||
<option value="invite">Invite</option>
|
||||
<option value="logging">Logging</option>
|
||||
<option value="web dashboard">Web Dashboard</option>
|
||||
<option value="reddit">Reddit</option>
|
||||
<option value="youtube">Youtube</option>
|
||||
<option value="twitch">Twitch</option>
|
||||
<option value="crypto">Crypto</option>
|
||||
<option value="roleplay">Roleplay</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>
|
||||
|
||||
@@ -34,15 +34,20 @@
|
||||
</p>
|
||||
</div>
|
||||
</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 src="https://unpkg.com/@popperjs/core@2"></script>
|
||||
<script src="https://unpkg.com/tippy.js@6"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('[data-tooltip]').each(function () {
|
||||
var title = $(this).attr('title');
|
||||
console.log($(this))
|
||||
tippy("[data-tooltip]", {
|
||||
content: title,
|
||||
appendTo: document.body,
|
||||
popperOptions: {
|
||||
strategy: 'fixed',
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -13,6 +13,7 @@
|
||||
</title>
|
||||
<link href="/css/style.css" rel="stylesheet">
|
||||
<script src="https://kit.fontawesome.com/204113bb1b.js" crossorigin="anonymous"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="bg-primary-color">
|
||||
@@ -58,7 +59,8 @@
|
||||
</div>
|
||||
<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"
|
||||
role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1" id="dropdown" style="z-index: 99 !important;">
|
||||
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>
|
||||
@@ -69,7 +71,9 @@
|
||||
<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>
|
||||
<a href="/me/servers" class="text-gray-700 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"
|
||||
id="menu-item-3"><li class="fa fa-server mr-1"></li>Edit server</a>
|
||||
id="menu-item-3">
|
||||
<li class="fa fa-server mr-1"></li>Edit server
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+57
-23
@@ -68,7 +68,7 @@
|
||||
<p class="content text-white text-center" style="opacity:.6">These bots are featured on BotsCord!</p>
|
||||
</div>
|
||||
<div
|
||||
class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 m-8">
|
||||
class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<div
|
||||
@@ -84,13 +84,22 @@
|
||||
<%= bot.description %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<a href="/bot/<%= bot.id %>"
|
||||
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i> View
|
||||
</a>
|
||||
<a href="/bot/<%= bot.id %>/invite"
|
||||
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-link" aria-hidden="true"></i> Invite
|
||||
</a>
|
||||
</div>
|
||||
<% if(bot.tags) {%>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<% bot.tags.forEach(tag=>{ %>
|
||||
<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>
|
||||
<a href="/tag/<%= tag %>"
|
||||
class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
@@ -114,7 +123,7 @@
|
||||
<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">
|
||||
class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<div
|
||||
@@ -130,13 +139,21 @@
|
||||
<%= bot.description %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<a href="/bot/<%= bot.id %>"
|
||||
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i> View
|
||||
</a>
|
||||
<a href="/bot/<%= bot.id %>/invite"
|
||||
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-link" aria-hidden="true"></i> Invite
|
||||
</a>
|
||||
</div>
|
||||
<% if(bot.tags) {%>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<% bot.tags.forEach(tag=>{ %>
|
||||
<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>
|
||||
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
@@ -160,7 +177,7 @@
|
||||
<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">
|
||||
class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<div
|
||||
@@ -176,13 +193,22 @@
|
||||
<%= bot.description %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<a href="/server/<%= bot.id %>"
|
||||
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i> View
|
||||
</a>
|
||||
<a href="/server/<%= bot.id %>/invite"
|
||||
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-link" aria-hidden="true"></i> Invite
|
||||
</a>
|
||||
</div>
|
||||
<% if(bot.tags) {%>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<% bot.tags.forEach(tag=>{ %>
|
||||
<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>
|
||||
<a href="/tag/<%= tag %>"
|
||||
class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
@@ -201,18 +227,18 @@
|
||||
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 class="text-xl text-white text-center"><i class="fa fa-shuffle" aria-hidden="true"></i> Random Servers
|
||||
</h2>
|
||||
<p class="content text-white text-center" style="opacity:.6">We rolled the dice and got this nice bots!</p>
|
||||
<p class="content text-white text-center" style="opacity:.6">We rolled the dice and got this nice Servers!</p>
|
||||
</div>
|
||||
<div
|
||||
class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 m-8">
|
||||
class="grid columns items-center content-center justify-center grid-cols-1 gap-4 col-auto sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 m-8">
|
||||
<% } %>
|
||||
<% for(let i=0; i < nbots.length; i++) { if (i===3) break; var bot=nbots[i]; if(bot) { %>
|
||||
<div
|
||||
class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color ">
|
||||
<img class="w-full rounded-full"
|
||||
src="https://cdn.discordapp.com/avatars/860390761307439114/2845a42b0c7868c3db29ea1996e84320.webp"
|
||||
src="<% bot.icon %> " onerror="this.src='/img/logo.png'"
|
||||
alt="<%= bot.name %>">
|
||||
<div class="px-6 py-4">
|
||||
<div class="font-bold text-xl mb-2 text-white">
|
||||
@@ -222,13 +248,21 @@
|
||||
<%= bot.description %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-6 pt-4 pb-2">
|
||||
<a href="/server/<%= bot.id %>"
|
||||
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i> View
|
||||
</a>
|
||||
<a href="/server<%= bot.id %>/invite"
|
||||
class="inline-block bg-blue-700 rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2" data-toggle="tooltip" title="Join the server" data-placement="top">
|
||||
<i class="fa fa-link" aria-hidden="true"></i> Invite
|
||||
</a>
|
||||
</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>
|
||||
<a href="/tag/<%= tag %>" class="inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2">#<%= tag %>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
class="block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"
|
||||
placeholder=" " required />
|
||||
<label for="floating_last_name"
|
||||
class="peer-focus:font-medium absolute text-sm text-white dark:text-white duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Server ID</label>
|
||||
</label>
|
||||
class="peer-focus:font-medium absolute text-sm text-white dark:text-white duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Server
|
||||
ID</label>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative z-0 mb-6 w-full group">
|
||||
@@ -30,7 +31,7 @@
|
||||
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>
|
||||
description (MarkDown supported!)</label>
|
||||
</div>
|
||||
<div class="relative z-0 mb-6 w-full group">
|
||||
<input type="text" name="server_short" id="floating_last_name"
|
||||
@@ -40,13 +41,24 @@
|
||||
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"
|
||||
<select multiple name="tags"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
||||
required>
|
||||
<option value="html">HTML</option>
|
||||
<option value="markdown">MarkDown</option>
|
||||
<option value="development">Development</option>
|
||||
<option value="fun">Fun</option>
|
||||
<option value="media">Media</option>
|
||||
<option value="company">Company</option>
|
||||
<option value="game">Game</option>
|
||||
<option value="emoji">Emoji</option>
|
||||
<option value="botlist">Bot List</option>
|
||||
<option value="serverlist">Server List</option>
|
||||
<option value="turkish">Turkish</option>
|
||||
<option value="support">Support</option>
|
||||
<option value="sound">Sound</option>
|
||||
<option value="chatting">Chatting</option>
|
||||
<option value="nsfw">NSFW</option>
|
||||
<option value="challange">Challange</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit"
|
||||
|
||||
@@ -1,2 +1,85 @@
|
||||
<%- include('../includes/header.ejs', { title: server.name}) %>
|
||||
|
||||
<%- include('../includes/header.ejs', {title: 'Bot' }) %>
|
||||
<br><br><br><br><br>
|
||||
<div class="flex space-x-4 py-2 lg:h-5/6 sm:min-h-min">
|
||||
<div class="p-10 bg-blue-color w-2/3 text-white h-full m-4 mx-14">
|
||||
<%= server.description %>
|
||||
|
||||
</div>
|
||||
<div class="bg-blue-color w-1/3 p-10 text-white h-full m-4 text-center">
|
||||
<h1 class="text-3xl">
|
||||
<%= server.name %>
|
||||
</h1>
|
||||
<!-- owners -->
|
||||
<a href="/server/<%= server.id %>/join" class="btn btn-BotsCord float-right" data-tooltip title="Join the server" data-placement="auto"><i class="fa fa-link"></i>
|
||||
Join</a>
|
||||
<% if(user) { if(serverr.members.cache.get(user.id)) {
|
||||
if(serverr.members.cache.get(user.id).permissions.has('ADMINISTRATOR')) { %>
|
||||
<div class="h6 mt-4">
|
||||
<i class="fa fa-user-crown"></i> Owner Options
|
||||
</div>
|
||||
<a href="/server/<%= server.id %>/edit" class="mt-1">
|
||||
<div class="box-2-p"><i class="mt-1 fa fa-pencil"></i></div>
|
||||
<p class="box-2">Edit Server</p>
|
||||
</a>
|
||||
<% } } } %>
|
||||
<h6 class="text-xl mt-4">
|
||||
<i class="fa fa-question-circle"></i>
|
||||
<p>Information</p>
|
||||
</h6>
|
||||
<div class="mt-1">
|
||||
<div class="box-2-p"><i class="mt-1 fa fa-users"></i></div>
|
||||
<p class="box-2">Members: <%= serverr.memberCount.toLocaleString().replace(',', '.' ) %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<div class="box-2-p"><i class="mt-1 fa fa-robot"></i></div>
|
||||
<p class="box-2">Bots: <%= serverr.members.cache.filter(a=> a.user.bot).size %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<div class="box-2-p"><i class="mt-1 fa fa-icons"></i></div>
|
||||
<p class="box-2">Emoji: <%= serverr.emojis.cache.size || "0" %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<div class="box-2-p"><i class="mt-1 fa fa-user"></i></div>
|
||||
<p class="box-2">Role Count: <%= serverr.roles.cache.size || "0" %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<div class="box-2-p"><i class="mt-1 fa fa-diamond"></i></div>
|
||||
<p class="box-2">Boost Level: <%= serverr.premiumTier || "0" %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="h6 mt-4">
|
||||
<i class="fa fa-user-crown"></i> Owners
|
||||
</div>
|
||||
<% serverr.members.cache.filter(a=> !a.user.bot && a.permissions.has('ADMINISTRATOR')).map(admin =>{
|
||||
%>
|
||||
<a style="text-decoration: none;margin-bottom: -5px;" href="/user/<%= admin.user.id %>"
|
||||
class="flex mt-1">
|
||||
<div class="h-5 w-5 rounded-lg"
|
||||
style="background: url(<%= admin.user.avatarURL({dynamic:true}) || '../../img/undefined_avatar.png' %>) center center no-repeat; background-size: 100%;">
|
||||
</div>
|
||||
<p translate="no" class="box-2">
|
||||
<%= admin.user.tag %>
|
||||
<% if(admin.user.id===serverr.ownerID) { %>
|
||||
<span data-toggle="tooltip" title="Join the server"><i
|
||||
class="fa fa-crown has-text-warning"></i></span>
|
||||
<% } %>
|
||||
</p>
|
||||
</a>
|
||||
<% }) %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br><br><br>
|
||||
|
||||
<%- include('../includes/footer.ejs') %>
|
||||
<!-- <% /*, meta: {
|
||||
site_name: 'Powered by Botscord',
|
||||
description: server.description + "🟢" + global.bsl.guilds.cache.get(server.id).members.cache.filter(a => a.presence.status != 'dnd').size + "online ⚫" +global.bsl.guilds.cache.get(server.id).memberCount + "members",
|
||||
image: server.icon
|
||||
} */
|
||||
%> -->
|
||||
Reference in new issue
Block a user