Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed May 4, 2023
1 parent 586fe4a commit aa473f9
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Ctor } from '@sapphire/utilities';
import type { CollectorFilter, EmojiResolvable, Message, MessageReaction, User } from 'discord.js';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from './constants';
import type {
IMessagePrompterExplicitConfirmReturn,
IMessagePrompterExplicitMessageReturn,
IMessagePrompterExplicitNumberReturn,
IMessagePrompterExplicitReturnBase
} from './ExplicitReturnTypes';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from './constants';
import { MessagePrompterBaseStrategy } from './strategies/MessagePrompterBaseStrategy';
import { MessagePrompterConfirmStrategy } from './strategies/MessagePrompterConfirmStrategy';
import { MessagePrompterMessageStrategy } from './strategies/MessagePrompterMessageStrategy';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type { MessagePrompterChannelTypes, MessagePrompterMessage } from './constants';
export * from './ExplicitReturnTypes';
export * from './MessagePrompter';
export type { MessagePrompterChannelTypes, MessagePrompterMessage } from './constants';
export * from './strategies/MessagePrompterBaseStrategy';
export * from './strategies/MessagePrompterConfirmStrategy';
export * from './strategies/MessagePrompterMessageStrategy';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { isNullish, type ArgumentTypes, type Awaitable } from '@sapphire/utilities';
import type { CollectorFilter, CollectorOptions, EmojiIdentifierResolvable, Message, MessageReaction, User } from 'discord.js';
import { isStageChannel, isTextBasedChannel } from '../../type-guards';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterExplicitReturnBase } from '../ExplicitReturnTypes';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterStrategyOptions } from '../strategyOptions';

export abstract class MessagePrompterBaseStrategy {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CollectorFilter, EmojiResolvable, MessageReaction, User } from 'discord.js';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterExplicitConfirmReturn } from '../ExplicitReturnTypes';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterConfirmStrategyOptions } from '../strategyOptions';
import { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { isNullish, type ArgumentTypes } from '@sapphire/utilities';
import type { CollectorFilter, CollectorOptions, Message, User } from 'discord.js';
import { isStageChannel, isTextBasedChannel } from '../../type-guards';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterExplicitMessageReturn } from '../ExplicitReturnTypes';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterStrategyOptions } from '../strategyOptions';
import { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CollectorFilter, EmojiIdentifierResolvable, MessageReaction, User } from 'discord.js';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterExplicitNumberReturn } from '../ExplicitReturnTypes';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterNumberStrategyOptions } from '../strategyOptions';
import { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CollectorFilter, EmojiIdentifierResolvable, EmojiResolvable, MessageReaction, User } from 'discord.js';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterExplicitReturnBase } from '../ExplicitReturnTypes';
import type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';
import type { IMessagePrompterReactionStrategyOptions } from '../strategyOptions';
import { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import { Time } from '@sapphire/duration';
import { deepClone, isFunction, isNullish, isObject } from '@sapphire/utilities';
import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
ChannelSelectMenuBuilder,
ComponentType,
EmbedBuilder,
GatewayIntentBits,
IntentsBitField,
InteractionCollector,
InteractionType,
MentionableSelectMenuBuilder,
Partials,
RoleSelectMenuBuilder,
StringSelectMenuBuilder,
UserSelectMenuBuilder,
isJSONEncodable,
userMention,
type APIActionRowComponent,
type APIEmbed,
type APIMessage,
type APIMessageActionRowComponent,
type BaseMessageOptions,
type Collection,
type InteractionReplyOptions,
type JSONEncodable,
type Message,
type MessageActionRowComponentBuilder,
type Snowflake,
type TextBasedChannel,
type User,
type WebhookMessageEditOptions,
ActionRowBuilder,
type APIActionRowComponent,
type MessageActionRowComponentBuilder,
ChannelSelectMenuBuilder,
MentionableSelectMenuBuilder,
RoleSelectMenuBuilder,
UserSelectMenuBuilder,
type APIMessageActionRowComponent
type WebhookMessageEditOptions
} from 'discord.js';
import { MessageBuilder } from '../builders/MessageBuilder';
import { isAnyInteraction, isGuildBasedChannel, isMessageInstance, isStageChannel } from '../type-guards';
Expand Down Expand Up @@ -1258,18 +1258,23 @@ export class PaginatedMessage {
if (isMessageButtonInteractionData(interaction)) {
return new ButtonBuilder(interaction);
}

if (isMessageUserSelectInteractionData(interaction)) {
return new UserSelectMenuBuilder(interaction);
}

if (isMessageRoleSelectInteractionData(interaction)) {
return new RoleSelectMenuBuilder(interaction);
}

if (isMessageMentionableSelectInteractionData(interaction)) {
return new MentionableSelectMenuBuilder(interaction);
}

if (isMessageChannelSelectInteractionData(interaction)) {
return new ChannelSelectMenuBuilder(interaction);
}

if (isMessageStringSelectInteractionData(interaction)) {
return new StringSelectMenuBuilder({
...(interaction.customId === '@sapphire/paginated-messages.goToPage' && {
Expand All @@ -1290,7 +1295,9 @@ export class PaginatedMessage {
});
}

throw new Error('Unsupported message component type');
throw new Error(
"Unsupported message component type detected. Validate your code and if you're sure this is a bug in Sapphire make a report in the server"
);
})
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {
ButtonBuilder,
ComponentType,
type APIActionRowComponent,
type APIMessageActionRowComponent,
type ActionRowComponentOptions,
type ButtonComponentData,
type MessageActionRowComponentBuilder,
type ChannelSelectMenuComponentData,
type MentionableSelectMenuComponentData,
type MessageActionRowComponentBuilder,
type RoleSelectMenuComponentData,
type StringSelectMenuComponentData,
type UserSelectMenuComponentData,
type APIMessageActionRowComponent,
type ChannelSelectMenuComponentData
type UserSelectMenuComponentData
} from 'discord.js';
import { isAnyInteractableInteraction, isMessageInstance } from '../type-guards';
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/discord.js-utilities/src/lib/type-guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
ChannelType,
GuildMember,
Message,
type VoiceBasedChannel,
type APIGuildMember,
type APIInteractionDataResolvedGuildMember,
type APIInteractionGuildMember,
Expand All @@ -19,6 +18,7 @@ import {
type StageChannel,
type TextChannel,
type ThreadChannel,
type VoiceBasedChannel,
type VoiceChannel
} from 'discord.js';
import type {
Expand Down

0 comments on commit aa473f9

Please sign in to comment.