Solved bot invite issue
This commit is contained in:
1 parent
17323bdc72
commit
44f2f765f7
4 files changed
+13
-6
No files matched your search
@@ -21,6 +21,7 @@ let hm = new mongoose.Schema({
|
|||||||
analytics_visitors: Number,
|
analytics_visitors: Number,
|
||||||
analytics_invites: Number,
|
analytics_invites: Number,
|
||||||
vanity: String,
|
vanity: String,
|
||||||
|
invite: String,
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = mongoose.model("bots", hm);
|
module.exports = mongoose.model("bots", hm);
|
||||||
@@ -59,6 +59,7 @@ router.post('/add', async function (req, res) {
|
|||||||
description: req.body.bot_short,
|
description: req.body.bot_short,
|
||||||
tags: req.body.tags,
|
tags: req.body.tags,
|
||||||
token: makeid(64),
|
token: makeid(64),
|
||||||
|
invite: req.body.bot_invite
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.save(function (err) {
|
bot.save(function (err) {
|
||||||
@@ -416,17 +417,18 @@ router.get('/:botID/invite', async function (req, res) {
|
|||||||
req.session.error = "No bot found";
|
req.session.error = "No bot found";
|
||||||
return res.redirect('/');
|
return res.redirect('/');
|
||||||
}
|
}
|
||||||
if (!bot.invite) {
|
if (bot.invite) {
|
||||||
|
return res.render('bot/join', {
|
||||||
|
bot: bot,
|
||||||
|
invite: bot.invite,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
var invite = "https://discord.com/oauth2/authorize?client_id=" + bot.id + "&scope=bot&permissions=8";
|
var invite = "https://discord.com/oauth2/authorize?client_id=" + bot.id + "&scope=bot&permissions=8";
|
||||||
return res.render('bot/join', {
|
return res.render('bot/join', {
|
||||||
bot: bot,
|
bot: bot,
|
||||||
invite: invite,
|
invite: invite,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return res.render('bot/join', {
|
|
||||||
bot: bot,
|
|
||||||
invite: bot.invite,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
<input type="text" name="bot_owners" id="floating_last_name" class="block py-2.5 px-0 w-full text-sm bg-transparent border-0 border-b-2 appearance-none text-white border-gray-600 focus:outline-none focus:ring-0 focus:border-blue-600 peer" placeholder=" " required />
|
<input type="text" name="bot_owners" id="floating_last_name" class="block py-2.5 px-0 w-full text-sm bg-transparent border-0 border-b-2 appearance-none text-white border-gray-600 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 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Owners (split with <strong>,</strong> ) (You are automatic included!)</label>
|
<label for="bot_name" class="peer-focus:font-medium absolute text-sm text-white duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Owners (split with <strong>,</strong> ) (You are automatic included!)</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="relative z-0 mb-6 w-full group">
|
||||||
|
<input type="text" name="bot_invite" id="floating_last_name" class="block py-2.5 px-0 w-full text-sm bg-transparent border-0 border-b-2 appearance-none text-white border-gray-600 focus:outline-none focus:ring-0 focus:border-blue-600 peer" placeholder=" " required />
|
||||||
|
<label for="bot_invite" class="peer-focus:font-medium absolute text-sm text-white duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Bot Invite Url</label>
|
||||||
|
</div>
|
||||||
<!-- tags -->
|
<!-- tags -->
|
||||||
<div class="relative z-0 mb-6 w-full group">
|
<div class="relative z-0 mb-6 w-full group">
|
||||||
<select multiple name="tags" class=" border text-sm rounded-lg block w-full p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500" required>
|
<select multiple name="tags" class=" border text-sm rounded-lg block w-full p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500" required>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<h1 class="text-3xl text-center">
|
<h1 class="text-3xl text-center">
|
||||||
<%= bot.name %>
|
<%= bot.name %>
|
||||||
</h1>
|
</h1>
|
||||||
<a href="/bot/<%= bot.id %>/join" class="button float-right inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2"><i class="fa fa-link"></i>
|
<a href="/bot/<%= bot.id %>/invite" class="button float-right inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2"><i class="fa fa-link"></i>
|
||||||
Invite</a>
|
Invite</a>
|
||||||
<a href="/bot/<%= bot.id %>/vote" class="button float-left inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2"><i class="fa fa-link"></i>
|
<a href="/bot/<%= bot.id %>/vote" class="button float-left inline-block bg-button-primary rounded-full px-3 py-1 text-sm font-semibold text-white mr-2 mb-2"><i class="fa fa-link"></i>
|
||||||
Vote</a>
|
Vote</a>
|
||||||
|
|||||||
Reference in new issue
Block a user