chmod
chmod
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by feelfeel2008 on 6/19/2024 in #djs-questions
DiscordAPIError[10062]
Rest default timeout is a bit different than interaction timeout, so when you deferReply initially, does the msg actually get deferred on discord? Does the bot show up as "thinking..." while your code on the other hand breaks?
18 replies
DIAdiscord.js - Imagine an app
Created by feelfeel2008 on 6/19/2024 in #djs-questions
DiscordAPIError[10062]
I may be facing the same thing so just joining the thread. Do you know how it breaks, does the defer time out? (rest default is 15 seconds)
18 replies
SIASapphire - Imagine a framework
Created by Jonny on 6/11/2024 in #sapphire-support
Issues with sending messages.
DJs people said multiple listeners could be it
26 replies
SIASapphire - Imagine a framework
Created by Jonny on 6/11/2024 in #sapphire-support
Issues with sending messages.
Can't say anything about your initial logging webhooks, those honestly look completely fine although I'm not in the same situation. I'm dealing only with the hanging defers that happen randomly in production when responding to command interactions, trying to figure out if we're in the same boat with that
26 replies
SIASapphire - Imagine a framework
Created by Jonny on 6/11/2024 in #sapphire-support
Issues with sending messages.
Does followUp right afterwards result in specifically unknown webhook?
26 replies
SIASapphire - Imagine a framework
Created by Jonny on 6/11/2024 in #sapphire-support
Issues with sending messages.
To further narrow down, are you calling deferReply? And does deffering throw an error?
26 replies
SIASapphire - Imagine a framework
Created by Jonny on 6/11/2024 in #sapphire-support
Issues with sending messages.
and it stays thinking forever right?
26 replies
SIASapphire - Imagine a framework
Created by Jonny on 6/11/2024 in #sapphire-support
Issues with sending messages.
deferReply does error but shows thinking... in discord right? code crashes and can't reply because of unknown interaction
26 replies
SIASapphire - Imagine a framework
Created by Jonny on 6/11/2024 in #sapphire-support
Issues with sending messages.
I might have the same issue
26 replies
TTCTheo's Typesafe Cult
Created by chmod on 7/15/2023 in #questions
help why bar any but not foo
nvm loses type enforcement for BaseRouter
14 replies
TTCTheo's Typesafe Cult
Created by chmod on 7/15/2023 in #questions
help why bar any but not foo
have it on the side too and it's pure sorcery too lol, but looks like mapping
type BaseRouter<CTX, T = AnyFn<CTX>> = {
[K in keyof T]: BaseRouter<CTX> | AnyFn<CTX>;
};
type BaseRouter<CTX, T = AnyFn<CTX>> = {
[K in keyof T]: BaseRouter<CTX> | AnyFn<CTX>;
};
annoyingly finally solved
14 replies
TTCTheo's Typesafe Cult
Created by chmod on 7/15/2023 in #questions
help why bar any but not foo
thanks for the efforts, I've been at this for several days (and yeah already there lol https://discord.com/channels/997886693233393714/1129809460966207558)
14 replies
TTCTheo's Typesafe Cult
Created by chmod on 7/15/2023 in #questions
help why bar any but not foo
a mini trpc
type AnyFn<CTX = void> = CTX extends void ? (...args: any[]) => any : (ctx: CTX, ...args: any[]) => any;
type GenId<Fn extends AnyFn, CTX> = CTX extends void
? (...args: Parameters<Fn>) => string
: OmitFirstArg<(...args: Parameters<Fn>) => string>;

type BaseRouter<CTX> = {
[key: string]: BaseRouter<CTX> | AnyFn<CTX>;
};

type ReplaceAnyFnWithGenId<T, CTX> = {
[K in keyof T]: T[K] extends AnyFn ? GenId<T[K], CTX> : T[K] extends BaseRouter<CTX> ? ReplaceAnyFnWithGenId<T[K], CTX> : never;
};
type AnyFn<CTX = void> = CTX extends void ? (...args: any[]) => any : (ctx: CTX, ...args: any[]) => any;
type GenId<Fn extends AnyFn, CTX> = CTX extends void
? (...args: Parameters<Fn>) => string
: OmitFirstArg<(...args: Parameters<Fn>) => string>;

type BaseRouter<CTX> = {
[key: string]: BaseRouter<CTX> | AnyFn<CTX>;
};

type ReplaceAnyFnWithGenId<T, CTX> = {
[K in keyof T]: T[K] extends AnyFn ? GenId<T[K], CTX> : T[K] extends BaseRouter<CTX> ? ReplaceAnyFnWithGenId<T[K], CTX> : never;
};
seems impossible without having BaseRouter be a mapped type itself sorta like
type BaseRouter<T = AnyFn> = {
[K in keyof T]: T[K] extends AnyFn
? T[K]
: T[K] extends Record<string, any>
? BaseRouter<T[K]>
: never;
};
type BaseRouter<T = AnyFn> = {
[K in keyof T]: T[K] extends AnyFn
? T[K]
: T[K] extends Record<string, any>
? BaseRouter<T[K]>
: never;
};
14 replies
TTCTheo's Typesafe Cult
Created by chmod on 7/15/2023 in #questions
help why bar any but not foo
oof still any really don't want to poison all references with generics but it seems it's inevitable
14 replies
TTCTheo's Typesafe Cult
Created by chmod on 7/15/2023 in #questions
help why bar any but not foo
thanks that worked! however now
function proxy<T extends AnyFunc>(fn: T) {
type Params = Parameters<T>; // can't do this anymore
return fn;
}
function proxy<T extends AnyFunc>(fn: T) {
type Params = Parameters<T>; // can't do this anymore
return fn;
}
fails with
Type 'Function' is not assignable to type '(...args: any) => any'
Type 'Function' is not assignable to type '(...args: any) => any'
14 replies
TTCTheo's Typesafe Cult
Created by chmod on 7/15/2023 in #questions
help why bar any but not foo
type AnyFunc = (...args: any[]) => any;
function proxy<T extends AnyFunc>(fn: T) {
return fn;
}
const nowBarIsAny = proxy((foo: string, bar = 23) => {});
// becomes ^? (foo: string, bar?: any) => void
// instead should be (foo: string, bar?: number) => void
type AnyFunc = (...args: any[]) => any;
function proxy<T extends AnyFunc>(fn: T) {
return fn;
}
const nowBarIsAny = proxy((foo: string, bar = 23) => {});
// becomes ^? (foo: string, bar?: any) => void
// instead should be (foo: string, bar?: number) => void
why does default bar become any, but foo works?
14 replies
SIASapphire - Imagine a framework
Created by chmod on 6/21/2023 in #sapphire-support
Converted to es6 module, commands not loading
thx legend
5 replies
DIAdiscord.js - Imagine an app
Created by chmod on 5/10/2023 in #djs-questions
get member role cache crash
you were 100% correct
7 replies
DIAdiscord.js - Imagine an app
Created by chmod on 5/10/2023 in #djs-questions
get member role cache crash
const guildRoles = guild.roles.cache;
guildRoles.delete(guild.roles.everyone?.id);
const guildRoles = guild.roles.cache;
guildRoles.delete(guild.roles.everyone?.id);
Forgot to .clone()
const guildRoles = guild.roles.cache.clone();
const guildRoles = guild.roles.cache.clone();
7 replies
DIAdiscord.js - Imagine an app
Created by chmod on 5/10/2023 in #djs-questions
get member role cache crash
yup just solved it
7 replies