fix: more imports

This commit is contained in:
TrèsAbhi committed 2024-09-08 10:11:24 -05:00
1 parent 25cfb7db74
commit 4f24db0956
182 files changed
+456 -452

No files matched your search

@@ -1,7 +1,7 @@
import { AutocompleteInteraction, CacheType } from 'discord.js';
import { commands } from '..';
export default async function handleAutocomplete(
export async function handleAutocomplete(
interaction: AutocompleteInteraction<CacheType>,
) {
const command = (await commands)[interaction.commandName];
@@ -2,9 +2,7 @@ import { ButtonInteraction, CacheType } from 'discord.js';
import { commands } from '..';
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
export default async function handleButton(
interaction: ButtonInteraction<CacheType>,
) {
export async function handleButton(interaction: ButtonInteraction<CacheType>) {
await interaction.deferUpdate();
const url = new URL(`https://example.com/${interaction.customId}`);
@@ -9,14 +9,14 @@ import {
} from 'discord.js';
import { InteractionRawReturnable, commands } from '..';
import { UserError } from '../../../../../website/src/hooks/userError';
import buttonLink from '../../../core/discord/buttonLink';
import embedWarning from '../../../core/discord/embedWarning';
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
import { buttonLink } from '../../../core/discord/buttonLink';
import { embedWarning } from '../../../core/discord/embedWarning';
import { normalizeInteractionReturnable } from '../../../core/discord/normalizeInteractionReturnable';
import { psa } from '../../../core/discord/psa';
import { translator } from '../../../core/localization/translator';
import { Writeable } from '../../../types/writable';
export default async function handleChatInputCommand(
export async function handleChatInputCommand(
interaction: ChatInputCommandInteraction<CacheType>,
) {
const awaitedCommands = await commands;
@@ -34,9 +34,9 @@ import { searchClansCommand } from '../../commands/searchClans';
import { searchPlayersCommand } from '../../commands/searchPlayers';
import { statsCommand } from '../../commands/stats';
import { todayCommand } from '../../commands/today';
import handleAutocomplete from './handlers/autocomplete';
import handleButton from './handlers/button';
import handleChatInputCommand from './handlers/chatInputCommand';
import { handleAutocomplete } from './handlers/autocomplete';
import { handleButton } from './handlers/button';
import { handleChatInputCommand } from './handlers/chatInputCommand';
export type InteractionRawReturnable =
| string
@@ -130,9 +130,7 @@ commands.then((awaitedCommands) => {
);
});
export default async function interactionCreate(
interaction: Interaction<CacheType>,
) {
export async function interactionCreate(interaction: Interaction<CacheType>) {
if (interaction.isAutocomplete()) {
handleAutocomplete(interaction);
} else if (interaction.isChatInputCommand()) {
+1 -1
View File
@@ -1,6 +1,6 @@
import { ActivityType, Client } from 'discord.js';
export default function ready(client: Client<true>) {
export function ready(client: Client<true>) {
console.log(`🟢 Launched bot ${client.shard?.ids[0] ?? 'default'}`);
const activities: (() => string)[] = [