Boost Logger

i dont know if thats the right way and have no one that boost the server to test it
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, GatewayIntentBits } = require('discord.js');
const register = require('../../utils/slashsync');

module.exports = async (client, oldBoosters, newBoosters) => {
console.log('Boost Tracker Started');
if (!oldBoosters.premiumSince && newBoosters.premiumSince) {
moxx = new EmbedBuilder()
.setTitle('New Booster')
.setColor('#2ecc71')
.setTimestamp()
.setImage9('https://cdn.discordapp.com/attachments/1142527483883815052/1166332765466275882/tasty5.png?ex=654a1b08&is=6537a608&hm=262855bf32eeca9c0824107061222f911a50569425d05da65b3ac68b0b7a55c7&')
.setDescription(`
> **• Booster:** ${newBoosters.user.tag}
> **• Boosts:** ${newBoosters.premiumSubscriptionCount}
> **• Since:** <t:${parseInt(newBoosters.premiumSinceTimestamp / 1000)}:R>

`);
const channel = client.channels.cache.get('1166108886273642636');
channel.send({ embeds: [moxx] });
}

}
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Client, GatewayIntentBits } = require('discord.js');
const register = require('../../utils/slashsync');

module.exports = async (client, oldBoosters, newBoosters) => {
console.log('Boost Tracker Started');
if (!oldBoosters.premiumSince && newBoosters.premiumSince) {
moxx = new EmbedBuilder()
.setTitle('New Booster')
.setColor('#2ecc71')
.setTimestamp()
.setImage9('https://cdn.discordapp.com/attachments/1142527483883815052/1166332765466275882/tasty5.png?ex=654a1b08&is=6537a608&hm=262855bf32eeca9c0824107061222f911a50569425d05da65b3ac68b0b7a55c7&')
.setDescription(`
> **• Booster:** ${newBoosters.user.tag}
> **• Boosts:** ${newBoosters.premiumSubscriptionCount}
> **• Since:** <t:${parseInt(newBoosters.premiumSinceTimestamp / 1000)}:R>

`);
const channel = client.channels.cache.get('1166108886273642636');
channel.send({ embeds: [moxx] });
}

}
No description
10 Replies
d.js toolkit
d.js toolkit14mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
treble/luna
treble/luna14mo ago
A member doesnt have a premiumsubscriptioncount property A guild does And i dont knownwhat setImage9 is supposed to do
noritem
noritemOP14mo ago
i miss typed it
souji
souji14mo ago
the member only changes when they first boost, there is no way to detect subsequent boosts, as the timestamp does not change
noritem
noritemOP14mo ago
also so? guild = client.guilds.cache.get('1166077612272123954');
• Boosts: ${guild.premiumSubscriptionCount}
treble/luna
treble/luna14mo ago
just member.guild works
souji
souji14mo ago
the only very scuffed way to do this is to set up boost notifications and listen for and process those messages and then you won't know when people stop boosting, and overall this is just not reliably trackable
noritem
noritemOP14mo ago
wdym
treble/luna
treble/luna14mo ago
No need to get from cache member.guild exists
noritem
noritemOP14mo ago
also just use > • Boosts: ${member.guild.premiumSubscriptionCount}
Want results from more Discord servers?
Add your server