Skip to content

Commit 407a7a6

Browse files
committed
stuff
1 parent d3c7700 commit 407a7a6

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/Classes/Client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ class BreadClient extends Client<true> {
285285
// TODO: skipping unchanged commands (done)
286286
// TODO: updating existing commands (done)
287287
// TODO: deleting removed commands
288+
// TODO: delete and recreate existing command if unpatchable
288289

289290
const res: StoredCommand[] = [];
290291
let intermediate: (Omit<StoredCommand, "raw"> & { raw: RESTPostAPIChatInputApplicationCommandsJSONBody; })[] = [];

src/Utils/discord.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ export async function sendSplit(ctx: Context, content: string): Promise<BreadMes
7474
return sendSplit(ctx, next);
7575
}
7676
return <Promise<BreadMessage>>ctx.send(content);
77-
} else if (ctx.isInteractionBased() && ctx.interaction.deferred) {
77+
} else if (ctx.isInteractionBased()) {
78+
ctx.defer();
79+
await ctx.ensureDeferredFinished();
7880
if (content.length <= 1950) return <Promise<BreadMessage>>ctx.interaction.editReply(content);
7981
let c = content.slice(1950).trim();
8082
let m = await ctx.interaction.editReply(content.slice(0, 1950));
@@ -85,5 +87,5 @@ export async function sendSplit(ctx: Context, content: string): Promise<BreadMes
8587
}
8688
return <BreadMessage>m;
8789
}
88-
throw new Error(`Can't handle context ${ctx}`);
90+
throw new Error("Can't handle context", { cause: ctx });
8991
}

0 commit comments

Comments
 (0)