diff --git a/bsl/index.js b/bsl/index.js index 904c826..f4a23ee 100644 --- a/bsl/index.js +++ b/bsl/index.js @@ -6,9 +6,9 @@ const colors = require('colors'); const bsl = colors.blue("BSL: "); const ms = require("parse-ms-2"); // Set intents -client.on('ready',async () => { - const bot = await bots.find({ verified: true}); - client.user.setPresence({ activities: [{ name: 'botscord.xyz | '+bot.length+' bots' }] }); +client.on('ready', async () => { + const bot = await bots.find({ verified: true }); + client.user.setPresence({ activities: [{ name: 'botscord.xyz | ' + bot.length + ' bots' }] }); console.log(bsl, 'Bot is ready!'); // Log server count setTimeout(() => { @@ -46,14 +46,14 @@ client.on('interactionCreate', async interaction => { } 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!`); - }else if (commandName === 'help') { + } else if (commandName === 'help') { await interaction.reply(` **Commands** \`ping\` - Replies with pong! \`topserver\` - Replies with highest server! \`user\` - Replies with user info and connected bots/servers! `); - }else if (commandName === 'bump') { + } else if (commandName === 'bump') { let findServer = await servers.findOne({ id: interaction.guild.id }); if (!findServer) return interaction.reply( "This server was not found in our list.\nAdd your server: https://botscord.xyz/server/add" @@ -65,7 +65,12 @@ client.on('interactionCreate', async interaction => { return interaction.reply(`You can bump again in ${time.minutes}m ${time.seconds}s`); } findServer.bump = Date.now(); - findServer.bumps++; + if (findServer.bumps == undefined) { + findServer.bumps = 1; + } else { + + findServer.bumps++; + } await findServer.save(); const embed = new EmbedBuilder() .setColor('#0099ff') @@ -74,7 +79,7 @@ client.on('interactionCreate', async interaction => { .setFooter({ iconURL: interaction.user.avatarURL(), text: 'BotsCord' }) .setTimestamp(); await interaction.reply({ embeds: [embed] }); - }else if (commandName === 'info') { + } else if (commandName === 'info') { } else { await interaction.reply('Command not found!'); diff --git a/config.js b/config.js index 2ffd050..fe14b28 100644 --- a/config.js +++ b/config.js @@ -1,27 +1,27 @@ 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: { id: "934087523649609768", token: "OTM0MDg3NTIzNjQ5NjA5NzY4.GV-g1-.Eggw57JNtsrLPbakg-_yr8fn8oBAbh0nKfK-lk", - channels:{ + channels: { login: "868065455628234780", vote: "937643610541793300", error: "1003947531543269507", info: "1005178285124239510", }, - bsl : { + bsl: { id: "870001234583621713", token: "ODcwMDAxMjM0NTgzNjIxNzEz.GfMe5Y.USVO8IBvKkPIX0PFbYFRgfpctT-wW8sBVmFLQc", - channels:{ - vote:"937643610541793300", - error:"1003947531543269507", + channels: { + vote: "937643610541793300", + error: "1003947531543269507", }, - 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" + 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:{ + discord: { id: "868065454940385291", - invite:"", + invite: "", roles: { admin: "868065454940385291", mod: "868065454940385291", @@ -32,6 +32,22 @@ module.exports = { server: { port: 3000, host: "http://localhost:3000", + tags: [ + "development", + "fun", + "media", + "company", + "game", + "emoji", + "botlist", + "serverlist", + "turkish", + "support", + "sound", + "chatting", + "nsfw", + "challange" + ] }, users: { owner: [""], diff --git a/index.js b/index.js index 8b9517a..aad7396 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,8 @@ const client = new Client({ const bsl = new Client({ intents: [ GatewayIntentBits.Guilds, + GatewayIntentBits.GuildMembers, + GatewayIntentBits.GuildPresences, ] }) client.config = config; @@ -85,4 +87,5 @@ module.exports.bsl = bsl; module.exports.embed = EmbedBuilder; global.client = client; global.bsl = bsl; -global.config = config; \ No newline at end of file +global.config = config; +global.discord = require('discord.js'); \ No newline at end of file diff --git a/models/server.js b/models/server.js index 2898d55..47499c0 100644 --- a/models/server.js +++ b/models/server.js @@ -2,7 +2,9 @@ const mongoose = require("mongoose"); let hm = new mongoose.Schema({ id: String, name: String, - description: String, + description: { + type: String, maxLength: 20 + }, owner: String, long_description: String, tags: [String], diff --git a/website/public/css/style.css b/website/public/css/style.css index d99e6ad..b591174 100644 --- a/website/public/css/style.css +++ b/website/public/css/style.css @@ -883,6 +883,9 @@ video { .w-1\/4 { width: 25%; } +.w-0 { + width: 0px; +} .max-w-7xl { max-width: 80rem; } @@ -1097,6 +1100,9 @@ video { .text-ellipsis { text-overflow: ellipsis; } +.text-clip { + text-overflow: clip; +} .break-words { overflow-wrap: break-word; } @@ -1319,6 +1325,9 @@ video { .p-2\.5 { padding: 0.625rem; } +.p-96 { + padding: 24rem; +} .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; @@ -2057,6 +2066,10 @@ body { display: inline-block; } + .lg\:flex { + display: flex; + } + .lg\:hidden { display: none; } diff --git a/website/routers/api/v1/index.js b/website/routers/api/v1/index.js index 667c22e..6fc2522 100644 --- a/website/routers/api/v1/index.js +++ b/website/routers/api/v1/index.js @@ -21,114 +21,115 @@ router.get('/search/:id', function (req, res) { res.json({ bot: bot, }) - - router.use(function (req, res, next) { - if (!req.headers.authorization) { - return res.status(403).json({ error: 'No credentials sent!' }); - } else { - bots.findOne({ token: req.headers.authorization }, function (err, bot) { - if (err) { - res.status(503).json({ - error: "Something went wrong" - }) - } - if (bot) { - if (bot.token == req.headers.authorization) { - next(); - } - } else { - res.status(403).json({ - error: "Unauthorized" - }) - } + }) +}) +router.use(function (req, res, next) { + if (!req.headers.authorization) { + return res.status(403).json({ error: 'No credentials sent!' }); + } else { + bots.findOne({ token: req.headers.authorization }, function (err, bot) { + if (err) { + res.status(503).json({ + error: "Something went wrong" }) } - next(); - }); - router.post('/bots/servers', function (req, res) { - if (req.headers.authorization) { - bots.findOne({ token: req.headers.authorization }, function (err, bot) { - if (err) { - res.status(503).json({ - error: "Something went wrong" - }) - } - if (bot) { - if (bot.token == req.headers.authorization) { - bot.servers = req.headers.servercount; - bot.save(function (err) { - if (err) { - res.status(503).json({ - error: "Something went wrong" - }) - } else { - res.status(200).json({ - message: "Success" - }) - } + if (bot) { + if (bot.token == req.headers.authorization) { + next(); + } + } else { + res.status(403).json({ + error: "Unauthorized" + }) + } + }) + } + next(); +}); +router.post('/bots/servers', function (req, res) { + if (req.headers.authorization) { + bots.findOne({ token: req.headers.authorization }, function (err, bot) { + if (err) { + res.status(503).json({ + error: "Something went wrong" + }) + } + if (bot) { + if (bot.token == req.headers.authorization) { + bot.servers = req.headers.servercount; + bot.save(function (err) { + if (err) { + res.status(503).json({ + error: "Something went wrong" }) } else { - res.status(403).json({ - error: "Invalid token or bot" + res.status(200).json({ + message: "Success" }) } - } else { - res.status(403).json({ - error: "Invalid token or bot" - }) - } - }) + }) + } else { + res.status(403).json({ + error: "Invalid token or bot" + }) + } } else { - res.status(401).json({ - message: "Please provide a bot token" + res.status(403).json({ + error: "Invalid token or bot" }) } - }); - - router.get('/bots/search/:id', function (req, res) { - bots.findOne({ id: req.params.id }, function (err, bot) { - if (err) { - res.status(503).json({ - error: "Something went wrong" - }) - } - if (bot) { - res.status(200).json({ - id: bot.id, - name: bot.name, - description: bot.description, - long_description: bot.long_description, - tags: bot.tags, - owners: bot.owners, - premium: bot.premium, - servers: bot.servers, - users: bot.users, - votes: bot.votes - }) - } else { - res.status(403).json({ - error: "No bot found" - }) - } - }); - }); - router.get('/bots/check/:id', function (req, res) { - votes.findOne({ user: req.params.id }, function (err, vote) { - if (err) { - res.status(503).json({ - error: "Something went wrong" - }) - } - if (vote) { - res.status(200).json({ - vote: true - }) - } else { - res.status(403).json({ - vote: false - }) - } - }); }) + } else { + res.status(401).json({ + message: "Please provide a bot token" + }) + } +}); - module.exports = router; \ No newline at end of file +router.get('/bots/search/:id', function (req, res) { + bots.findOne({ id: req.params.id }, function (err, bot) { + if (err) { + res.status(503).json({ + error: "Something went wrong" + }) + } + if (bot) { + res.status(200).json({ + id: bot.id, + name: bot.name, + description: bot.description, + long_description: bot.long_description, + tags: bot.tags, + owners: bot.owners, + premium: bot.premium, + servers: bot.servers, + users: bot.users, + votes: bot.votes + }) + } else { + res.status(403).json({ + error: "No bot found" + }) + } + }); +}); +router.get('/bots/check/:id', function (req, res) { + votes.findOne({ user: req.params.id }, function (err, vote) { + if (err) { + res.status(503).json({ + error: "Something went wrong" + }) + } + if (vote) { + res.status(200).json({ + vote: true + }) + } else { + res.status(403).json({ + vote: false + }) + } + }); +}) + +module.exports = router; \ No newline at end of file diff --git a/website/views/includes/header.ejs b/website/views/includes/header.ejs index 70f1f54..37532c2 100644 --- a/website/views/includes/header.ejs +++ b/website/views/includes/header.ejs @@ -1,15 +1,16 @@ + BotsCord | <% if (typeof title !="undefined" ) { %> - <%= title %> - <% } else { %> - Home - <% } %> + <%= title %> + <% } else { %> + Home + <% } %> @@ -19,24 +20,24 @@ - + <% if(typeof server !="undefined" ) { %> - - - - - <% } %> - - - - - - - - - + + + + + <% } %> + + + + + + + + @@ -47,27 +48,19 @@
- <% if (typeof error !="undefined" ) { %> - - <% } %> - <% if (typeof message !="undefined" ) { %> - - <% } %> + + <% } %> + <% if (typeof message !="undefined" ) { %> + + <% } %>