Skip to content

Commit

Permalink
deprecation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Larsundso committed Jan 17, 2025
1 parent edb341b commit de8aa78
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/BaseClient/Bot/DataBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export default prisma
name: 'Cache Middleware',
query: {
guildsettings: {
$allOperations: async (data) => handleOperation('guildsettings', 'guildid', data),
$allOperations: async (data) => handleOperation('guildsettings', 'guildid', data as never),
},
logchannels: {
$allOperations: async (data) => handleOperation('logchannels', 'guildid', data),
$allOperations: async (data) => handleOperation('logchannels', 'guildid', data as never),
},
customclients: {
$allOperations: async (data) => handleOperation('customclients', 'guildid', data),
$allOperations: async (data) => handleOperation('customclients', 'guildid', data as never),
},
},
})
Expand Down
4 changes: 3 additions & 1 deletion src/BaseClient/UtilModules/fileURL2Buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ export default async (
name: fileName,
};
})
.filter((r): r is { attachment: Buffer; name: string | undefined } => !!r);
.filter(
(r): r is { attachment: Buffer<ArrayBuffer>; name: string | undefined } => !!r,
) as Discord.AttachmentPayload[];
2 changes: 1 addition & 1 deletion src/BaseClient/UtilModules/getTrueChannelType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default (channel: Discord.Channel | Discord.GuildChannel, guild: Discord.
return 'Thread';
case Discord.ChannelType.GuildStageVoice:
return 'Stage';
case Discord.ChannelType.GuildDirectory:
case Discord.ChannelType.GuildDirectory as (typeof channel)['type']:
return 'Directory';
case Discord.ChannelType.GuildForum: {
switch (true) {
Expand Down
2 changes: 1 addition & 1 deletion src/BaseClient/UtilModules/guildOnly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default async (
cmd.reply({
embeds: [embed],
ephemeral: true,
fetchReply: false,
withResponse: false,
components: [
{
type: Discord.ComponentType.ActionRow,
Expand Down
2 changes: 1 addition & 1 deletion src/BaseClient/UtilModules/mod/startLoading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ export default async (
if (cmd instanceof Discord.Message) {
return replyMsg(cmd, payload);
}
return replyCmd(cmd, { ...payload, fetchReply: true });
return replyCmd(cmd, { ...payload, withResponse: true });
};
8 changes: 4 additions & 4 deletions src/BaseClient/UtilModules/replyCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type ReturnType<T extends boolean | undefined, K extends Discord.CacheType> = T
* Sends a reply to an interaction (button, command, select menu, or modal submit).
* @param cmd The interaction to reply to.
* @param payload The reply options to send.
* @returns If `fetchReply` is `true`, returns the message that was sent.
* @returns If `withResponse` is `true`, returns the message that was sent.
* Otherwise, returns `undefined`.
* @throws If the interaction is not repliable.
*/
Expand All @@ -26,7 +26,7 @@ const replyCmd = async <T extends boolean | undefined, K extends Discord.CacheTy
| Discord.AnySelectMenuInteraction<K>
| Discord.ModalSubmitInteraction<K>,
payload: Discord.InteractionReplyOptions & {
fetchReply?: T;
withResponse?: T;
},
): Promise<ReturnType<T, K>> => {
if ('respond' in cmd) return Promise.resolve(undefined);
Expand Down Expand Up @@ -80,7 +80,7 @@ const replyCmd = async <T extends boolean | undefined, K extends Discord.CacheTy
* @param command The command that triggered the interaction.
* @param commandName The name of the command that triggered the interaction,
* required for handling cooldowns.
* @returns The sent message if `fetchReply` is `true`, otherwise `undefined`.
* @returns The sent message if `withResponse` is `true`, otherwise `undefined`.
*/
export default async <T extends boolean | undefined, K extends Discord.CacheType>(
cmd:
Expand All @@ -89,7 +89,7 @@ export default async <T extends boolean | undefined, K extends Discord.CacheType
| Discord.AnySelectMenuInteraction<K>
| Discord.ModalSubmitInteraction<K>,
payload: Discord.InteractionReplyOptions & {
fetchReply?: T;
withResponse?: T;
},
commandName?: string,
): Promise<ReturnType<T, K>> => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const getEmbeds: CT.SettingsFile<typeof name>['getEmbeds'] = async (
? Discord.inlineCode(
`${settings.botToken.split('.')[0]}.${'*'.repeat(
settings.botToken.split('.')[1]?.length,
)}.${'*'.repeat(settings.botToken.split('.')[2].length)}`,
)}.${'*'.repeat(settings.botToken.split('.')[2]?.length)}`,
)
: language.t.None,
inline: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const oneTimeRunner = async (
})
.then();

await cmd?.deferReply({ fetchReply: true, ephemeral: true });
await cmd?.deferReply({ withResponse: true });

const members = await getMembers(guild, rows);

Expand Down
2 changes: 1 addition & 1 deletion src/Events/ClusterEvents/interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Please invite the original Bot into your Server, instead of this one, using [thi
},
},
],
flags: 64,
flags: Discord.MessageFlags.Ephemeral,
})
.catch(() => undefined);
};

0 comments on commit de8aa78

Please sign in to comment.