Skip to content

Commit

Permalink
[PATCH] sleep for a sec
Browse files Browse the repository at this point in the history
  • Loading branch information
Larsundso committed Dec 27, 2023
1 parent 1660d37 commit 49bf600
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"version": "1.6.60",
"version": "1.6.61",
"scripts": {
"start": "node --max-old-space-size=8192 ./dist/index.js",
"build": "npx tsc",
Expand Down
5 changes: 4 additions & 1 deletion src/BaseClient/ClientHelperModules/getAudit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type * as Discord from 'discord.js';
import getUnix from './getUnix.js';
import cache from './cache.js';
import getUnix from './getUnix.js';
import sleep from './sleep.js';

/**
* Retrieves the latest audit log entry of a given type and target ID (if provided) in a guild.
Expand All @@ -11,6 +12,8 @@ import cache from './cache.js';
* and target ID (if provided), or undefined if no such entry exists.
*/
export default async (guild: Discord.Guild, type: number, targetId?: string) => {
await sleep(1000);

const audits = await cache.auditLogs.get(guild, type);
if (!audits?.length) return undefined;

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/ButtonCommands/rp/toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const deleteAll = async (cmd: Discord.ButtonInteraction<'cached'>) => {
[...(ch.cache.commands.cache.get(cmd.guild.id)?.values() ?? [])] ??
cmd.guild.commands.cache.map((c) => c)
)
.filter((c) => !ch.constants.commands.interactions.find((i) => i.name === c.name) && !!c.guildId)
.filter((c) => !ch.constants.commands.interactions.find((i) => i.name === c.name) && !c.guildId)
.map((c) => c.toJSON() as Discord.APIApplicationCommand),
);
};
Expand Down Expand Up @@ -106,7 +106,7 @@ export const create = async (guild: Discord.Guild) => {
.filter(
(c) =>
!ch.constants.commands.interactions.find((i) => i.name === c.name) &&
!!c.guildId &&
!c.guildId &&
!registerCommands.find((r) => r.name === c.name),
)
.map((c) => c.toJSON() as Discord.APIApplicationCommand),
Expand Down

0 comments on commit 49bf600

Please sign in to comment.