Virtus
Virtus
Explore posts from servers
PPrisma
Created by Virtus on 7/5/2024 in #help-and-questions
ID needed in delete()?
Using deleteMany as a hacky bypass is not going to work either, because I also have an upsert query that will have the exact same problem
await this.DiscordMembers.upsert({
create: {
guild_id: guildId,
id: member.user.id,
nick: member.nick ?? null,
avatar: member.avatar ?? null,
joined_at: member.joined_at ?? null,
premium_since: member.premium_since ?? null,
deaf: member.deaf ?? null,
mute: member.mute ?? null,
flags: member.flags ?? null,
pending: member.pending ?? null,
communication_disabled_until: member.communication_disabled_until ?? null,
// @ts-ignore - We can't really depend on this property ever being populated
permissions: member?.permissions ? BigInt(member.permissions) : null,
},
update: {
nick: member.nick ?? null,
avatar: member.avatar ?? null,
joined_at: member.joined_at ?? null,
premium_since: member.premium_since ?? null,
deaf: member.deaf ?? null,
mute: member.mute ?? null,
flags: member.flags ?? null,
pending: member.pending ?? null,
communication_disabled_until: member.communication_disabled_until ?? null,
// @ts-ignore - We can't really depend on this property ever being populated
permissions: member?.permissions ? BigInt(member.permissions) : null,
},
where: {
guild_id: guildId,
id: member.user.id,
}
});
await this.DiscordMembers.upsert({
create: {
guild_id: guildId,
id: member.user.id,
nick: member.nick ?? null,
avatar: member.avatar ?? null,
joined_at: member.joined_at ?? null,
premium_since: member.premium_since ?? null,
deaf: member.deaf ?? null,
mute: member.mute ?? null,
flags: member.flags ?? null,
pending: member.pending ?? null,
communication_disabled_until: member.communication_disabled_until ?? null,
// @ts-ignore - We can't really depend on this property ever being populated
permissions: member?.permissions ? BigInt(member.permissions) : null,
},
update: {
nick: member.nick ?? null,
avatar: member.avatar ?? null,
joined_at: member.joined_at ?? null,
premium_since: member.premium_since ?? null,
deaf: member.deaf ?? null,
mute: member.mute ?? null,
flags: member.flags ?? null,
pending: member.pending ?? null,
communication_disabled_until: member.communication_disabled_until ?? null,
// @ts-ignore - We can't really depend on this property ever being populated
permissions: member?.permissions ? BigInt(member.permissions) : null,
},
where: {
guild_id: guildId,
id: member.user.id,
}
});
4 replies
DIAdiscord.js - Imagine an app
Created by Virtus on 6/21/2023 in #djs-questions
How does RequestManager work?
But thanks for your input!
5 replies
DIAdiscord.js - Imagine an app
Created by Virtus on 6/21/2023 in #djs-questions
How does RequestManager work?
Aye. In the future though I'm going to have to make it truly stateless (as far as it can be) by relying on Redis or so for retrieving the limits for buckets greyW
5 replies
DIAdiscord.js - Imagine an app
Created by Virtus on 6/21/2023 in #djs-questions
How does RequestManager work?
If this is true, it means that my approach to make the request token agnostic by having it explicitly pass a token is going to potentially work against me? Since it could be that a route with bot token A is considered the same as with bot token B, either causing unnecessary "wait" periods, and potentially bugs where rate limiting is not handled properly hm
5 replies
DIAdiscord.js - Imagine an app
Created by Virtus on 3/6/2023 in #djs-questions
No `Ready` event dispatached
Ah yes, that did the trick. Thank you
3 replies