piemot
piemot
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by piemot on 4/14/2024 in #djs-questions
Do sweepers invalidate references to the swept object?
For instance, if my sweeper setup is
{
GuildMemberManager: {
maxSize: 200,
keepOverLimit: (member) => member.id === member.client.user.id
}
}
{
GuildMemberManager: {
maxSize: 200,
keepOverLimit: (member) => member.id === member.client.user.id
}
}
, but I fetch members somewhere else via a guild.members.fetch() call:
export let members = null;
export async doFetchCall(guild) {
const mx = await guild.members.fetch();
members = mx;
}
export let members = null;
export async doFetchCall(guild) {
const mx = await guild.members.fetch();
members = mx;
}
and hold that array in memory for future access, what happens to the member objects when the sweeper triggers? Are they protected and thus the sweeper holds more member objects than the maximum?
3 replies
DIAdiscord.js - Imagine an app
Created by piemot on 7/6/2023 in #djs-questions
Typing Oauth2Guild
Does anyone know if discord-api-types has a builtin type for an Oauth2Guild (i.e. a guild fetched via the oauth2 api/v10/users/@me/guilds route) or would it just be
import type { APIPartialGuild } from 'discord-api-types/v10';
export interface Oauth2Guild extends APIPartialGuild {
permissions: string;
}
import type { APIPartialGuild } from 'discord-api-types/v10';
export interface Oauth2Guild extends APIPartialGuild {
permissions: string;
}
7 replies
DIAdiscord.js - Imagine an app
Created by piemot on 2/20/2023 in #djs-questions
Detect bot's inviter
Is there any way to find the user that invited the bot when it's added to a guild?
4 replies
SIASapphire - Imagine a framework
Created by piemot on 1/25/2023 in #sapphire-support
Typing the Err generic of Result to be empty
Sorry if this is a basic Typescript question! Is it possible to type a function's output so that I can return Result.err() without any parameters? f.e.
function myFunction(): Result<true, ???> {
if (condition)
return Result.ok(true)
else
return Result.err()
}
function myFunction(): Result<true, ???> {
if (condition)
return Result.ok(true)
else
return Result.err()
}
5 replies