Skip to content

Commit

Permalink
feat: Add support for modals, and fix some other stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
S222em committed May 13, 2022
1 parent c408845 commit bae9615
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 89 deletions.
186 changes: 115 additions & 71 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@typescript-eslint/eslint-plugin": "5.23.0",
"@typescript-eslint/parser": "5.23.0",
"conventional-changelog-cli": "2.2.2",
"discord.js": "13.6.0",
"discord.js": "13.7.0",
"eslint": "8.15.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
Expand Down
3 changes: 2 additions & 1 deletion src/handlers/AutocompleteHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { GClient } from '../lib/GClient';
import { Commands } from '../lib/managers/CommandManager';
import type { Argument, ArgumentOptions } from '../lib/structures/Argument';
import { AutocompleteContext } from '../lib/structures/contexts/AutocompleteContext';
import { Logger, Events } from '../lib/util/logger/Logger';
import { Events, Logger } from '../lib/util/logger/Logger';

export async function AutocompleteHandler(
interaction: AutocompleteInteraction,
Expand Down Expand Up @@ -36,6 +36,7 @@ export async function AutocompleteHandler(
guild: interaction.guild,
guildId: interaction.guildId,
user: interaction.user,
// @ts-expect-error Idk what this is
member: interaction.member,
memberPermissions: interaction.memberPermissions,
command: command,
Expand Down
4 changes: 3 additions & 1 deletion src/handlers/ComponentHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Handlers } from '../lib/managers/HandlerManager';
import { ComponentType } from '../lib/structures/Component';
import { ComponentContext } from '../lib/structures/contexts/ComponentContext';
import { Util } from '../lib/util/Util';
import { Logger, Events } from '../lib/util/logger/Logger';
import { Events, Logger } from '../lib/util/logger/Logger';

const cooldowns = new Collection<string, Collection<string, number>>();

Expand Down Expand Up @@ -56,12 +56,14 @@ export async function ComponentHandler(
guild: interaction.guild,
guildId: interaction.guildId,
user: interaction.user,
// @ts-expect-error Idk what this is
member: interaction.member,
memberPermissions: interaction.memberPermissions,
component: component,
customId: interaction.customId,
arguments: args,
values: interaction.isSelectMenu() ? interaction.values : undefined,
fields: interaction.isModalSubmit() ? interaction.fields : undefined,
deferReply: interaction.deferReply.bind(interaction),
deferUpdate: interaction.deferUpdate.bind(interaction),
deleteReply: interaction.deleteReply.bind(interaction),
Expand Down
3 changes: 2 additions & 1 deletion src/handlers/InteractionCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Commands } from '../lib/managers/CommandManager';
import { Handlers } from '../lib/managers/HandlerManager';
import { CommandContext } from '../lib/structures/contexts/CommandContext';
import { Util } from '../lib/util/Util';
import { Logger, Events } from '../lib/util/logger/Logger';
import { Events, Logger } from '../lib/util/logger/Logger';

const cooldowns = new Collection<string, Collection<string, number>>();

Expand Down Expand Up @@ -55,6 +55,7 @@ export async function InteractionCommandHandler(
guild: interaction.guild,
guildId: interaction.guildId,
user: interaction.user,
// @ts-expect-error Idk what this is
member: interaction.member,
memberPermissions: interaction.memberPermissions,
command: command,
Expand Down
Loading

0 comments on commit bae9615

Please sign in to comment.