pup
pup
DIAdiscord.js - Imagine a bot
Created by pup on 12/7/2023 in #djs-questions
is there a way to align text to center automatically in an embed?
ok lol
4 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
didn't even realise i was replying sorry
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
:((
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
i got it sry i was being stupid
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
but how do i use te state property?
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
might be using it wrong
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
activities is returning not a function
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
alr thanks
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
alr ty
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
so how do i get custom status of user than
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
yeah it returns the presence
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
ah gotchu
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
oh you mean
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
console.log('this ' + newPresence)
console.log('this ' + newPresence)
returns undefined
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
no
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
hm?
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
client.on('presenceUpdate', async (oldPresence, newPresence) => {
console.log(oldPresence + ' and ' + newPresence)
if (newPresence.member.presence.status.includes("something")) {
let userProfile = await UserProfile.findOne({
userid: newPresence.member.id,
});

if (userProfile) {
const lastPresenceDate = userProfile.lastPresenceCollected?.toDateString();
const currenDate = new Date().toDateString();

if (lastPresenceDate === currenDate) {
console.log('WAITTT A DAY.').catch((err) => console.error(err));
return;
}
} else {
userProfile = new UserProfile({
userid: interaction.member.id,
});
}

userProfile.balance += presenceAmount;
userProfile.lastPresenceCollected = new Date();

await userProfile.save();

console.log(`You claimed **$${presenceAmount}** from daily reward!`)
}
});
client.on('presenceUpdate', async (oldPresence, newPresence) => {
console.log(oldPresence + ' and ' + newPresence)
if (newPresence.member.presence.status.includes("something")) {
let userProfile = await UserProfile.findOne({
userid: newPresence.member.id,
});

if (userProfile) {
const lastPresenceDate = userProfile.lastPresenceCollected?.toDateString();
const currenDate = new Date().toDateString();

if (lastPresenceDate === currenDate) {
console.log('WAITTT A DAY.').catch((err) => console.error(err));
return;
}
} else {
userProfile = new UserProfile({
userid: interaction.member.id,
});
}

userProfile.balance += presenceAmount;
userProfile.lastPresenceCollected = new Date();

await userProfile.save();

console.log(`You claimed **$${presenceAmount}** from daily reward!`)
}
});
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
undefined and undefined
undefined and undefined
ha
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
...
47 replies
DIAdiscord.js - Imagine a bot
Created by pup on 8/14/2023 in #djs-questions
newPresence returns undefined inside presenceUpdate event
the code inside is not done yet but that doesn't matter
47 replies