diff options
Diffstat (limited to 'src/lib/common')
-rw-r--r-- | src/lib/common/ButtonPaginator.ts | 9 | ||||
-rw-r--r-- | src/lib/common/util/Arg.ts | 7 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts index c74f6ad..68955cc 100644 --- a/src/lib/common/ButtonPaginator.ts +++ b/src/lib/common/ButtonPaginator.ts @@ -118,15 +118,12 @@ export class ButtonPaginator { } protected async end() { - try { - return this.sentMessage!.edit({ + if (!this.deleteOnExit) + return await this.sentMessage!.edit({ content: this.text, embeds: [this.embeds[this.curPage]], components: [this.getPaginationRow(true)] - }); - } catch (e) { - return undefined; - } + }).catch(() => undefined); } protected async edit(interaction: MessageComponentInteraction) { diff --git a/src/lib/common/util/Arg.ts b/src/lib/common/util/Arg.ts index 84d5aeb..d267eb9 100644 --- a/src/lib/common/util/Arg.ts +++ b/src/lib/common/util/Arg.ts @@ -1,4 +1,4 @@ -import { Argument, ArgumentTypeCaster, Flag, ParsedValuePredicate, TypeResolver } from 'discord-akairo'; +import { AkairoMessage, Argument, ArgumentTypeCaster, Flag, ParsedValuePredicate } from 'discord-akairo'; import { Message } from 'discord.js'; import { BushArgumentType } from '../..'; @@ -6,12 +6,11 @@ export class Arg { /** * Casts a phrase to this argument's type. * @param type - The type to cast to. - * @param resolver - The type resolver. * @param message - Message that called the command. * @param phrase - Phrase to process. */ - public static cast(type: BushArgumentType, resolver: TypeResolver, message: Message, phrase: string): Promise<any> { - return Argument.cast(type, resolver, message, phrase); + public static cast(type: BushArgumentType, message: Message | AkairoMessage, phrase: string): Promise<any> { + return Argument.cast(type, client.commandHandler.resolver, message as Message, phrase); } /** |