Updated message for votes

This commit is contained in:
CorwinDev committed 2022-08-17 15:57:55 +02:00
1 parent 06eaf75d79
commit 514a1183b8
3 files changed
+6 -18

No files matched your search

+2
View File
@@ -267,6 +267,7 @@ router.get('/:botID/vote', async function (req, res) {
return res.redirect('/');
}
})
global.client.channels.cache.get(global.config.bot.channels.vote).send(`${req.user.username} has voted for bot: ${bot.name} | <https://botscord.xyz/bot/${bot.id}>`);
req.session.message = "Vote added";
return res.redirect('/');
@@ -295,6 +296,7 @@ router.get('/:botID/vote', async function (req, res) {
req.session.error = "Something went wrong";
return res.redirect('/');
} else {
global.client.channels.cache.get(global.config.bot.channels.vote).send(`${req.user.username} has voted for bot: ${bot.name} | <https://botscord.xyz/bot/${bot.id}>`);
req.session.message = "Vote added";
return res.redirect('/');
}
+2 -16
View File
@@ -298,14 +298,7 @@ router.get('/:server/vote', function (req, res) {
console.log(e);
}
}
const embed = new Discord.EmbedBuilder()
.setColor('#0099ff')
.setTitle(`${req.user.username} has voted for ${bot.name}`)
.setDescription(`[${bot.name}](${bot.url})`)
.setThumbnail(global.bsl.guilds.cache.get(bot.id).iconURL({ format: 'png' }))
.setFooter({ text: "BotsCord", iconURL: "https://botscord.xyz/img/logo.png" })
.setTimestamp();
global.client.channels.cache.get(global.config.bot.channels.vote).send({ embeds: [embed] });
global.client.channels.cache.get(global.config.bot.channels.vote).send(`${req.user.username} has voted for server ${bot.name} | <https://botscord.xyz/server/${bot.id}>`);
req.session.message = "Vote added";
return res.redirect('/');
})
@@ -345,14 +338,7 @@ router.get('/:server/vote', function (req, res) {
console.log(e);
}
}
const embed = new Discord.EmbedBuilder()
.setColor('#0099ff')
.setTitle(`${req.user.username} has voted for ${bot.name}`)
.setDescription(`[${bot.name}](${bot.url})`)
.setThumbnail(global.bsl.guilds.cache.get(bot.id).iconURL({ format: 'png' }))
.setFooter({ text: "BotsCord", iconURL: "https://botscord.xyz/img/logo.png" })
.setTimestamp();
global.client.channels.cache.get(global.config.bot.channels.vote).send({ embeds: [embed] });
global.client.channels.cache.get(global.config.bot.channels.vote).send(`${req.user.username} has voted for server ${bot.name} | <https://botscord.xyz/server/${bot.id}>`);
req.session.message = "Vote added";
return res.redirect('/');
}
+2 -2
View File
@@ -21,7 +21,7 @@
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color " onclick="location.href='/bot/<%=bot.id%> ';" style="cursor: pointer;">
<img class="w-full rounded-full" src="<%= getBot.iconURL({ format: 'png' }) %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
<div class="px-6 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %>
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <i class="fa fa-user"></i>: <%= global.bsl.guilds.cache.get(bot.id).memberCount.toLocaleString().replace(',', '.' ) %><span class="float-right"><i class="fa fa-bomb"></i>: <%=bot.bumps %></span>
</p>
</div>
<div class="px-6 py-4">
@@ -66,7 +66,7 @@
<div class="transition-shadow ease-in-out duration-300 hover:shadow-blue-900 shadow-2xl rounded-lg max-w-sm bg-blue-color " onclick="location.href='/bot/<%=bot.id%> ';" style="cursor: pointer;">
<img class="w-full rounded-full" src="<%= getBot.iconURL({ format: 'png' }) %>" onerror="this.src='/img/logo.webp'" alt="<%= bot.name %>">
<div class="px-6 text-white text-base">
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %>
<p><i class="fa-solid fa-check-to-slot"></i>: <%= bot.votes || 0 %> <i class="fa fa-user"></i>: <%= global.bsl.guilds.cache.get(bot.id).memberCount.toLocaleString().replace(',', '.' ) %><span class="float-right"><i class="fa fa-bomb"></i>: <%=bot.bumps %></span>
</p>
</div>
<div class="px-6 py-4">