refactor!: fix some spelling mistakes (#2144)

* refactor!: fix some spelling mistakes
This fixes some spelling mistakes around the code base. Note not all are fixed.

* subComponent
This commit is contained in:
ITOH
2022-03-31 14:16:34 +02:00
committed by GitHub
parent bcaa43ab7d
commit 9980856eef
50 changed files with 493 additions and 370 deletions
+27 -27
View File
@@ -33,27 +33,27 @@ export async function editMessage(bot: Bot, channelId: bigint, messageId: bigint
file: content.file,
components: content.components?.map((component) => ({
type: component.type,
components: component.components.map((subcomponent) => {
if (subcomponent.type === MessageComponentTypes.InputText) {
components: component.components.map((subComponent) => {
if (subComponent.type === MessageComponentTypes.InputText) {
return {
type: subcomponent.type,
style: subcomponent.style,
custom_id: subcomponent.customId,
label: subcomponent.label,
placeholder: subcomponent.placeholder,
min_length: subcomponent.minLength ?? subcomponent.required === false ? 0 : subcomponent.minLength,
max_length: subcomponent.maxLength,
type: subComponent.type,
style: subComponent.style,
custom_id: subComponent.customId,
label: subComponent.label,
placeholder: subComponent.placeholder,
min_length: subComponent.minLength ?? subComponent.required === false ? 0 : subComponent.minLength,
max_length: subComponent.maxLength,
};
}
if (subcomponent.type === MessageComponentTypes.SelectMenu) {
if (subComponent.type === MessageComponentTypes.SelectMenu) {
return {
type: subcomponent.type,
custom_id: subcomponent.customId,
placeholder: subcomponent.placeholder,
min_values: subcomponent.minValues,
max_values: subcomponent.maxValues,
options: subcomponent.options.map((option) => ({
type: subComponent.type,
custom_id: subComponent.customId,
placeholder: subComponent.placeholder,
min_values: subComponent.minValues,
max_values: subComponent.maxValues,
options: subComponent.options.map((option) => ({
label: option.label,
value: option.value,
description: option.description,
@@ -70,19 +70,19 @@ export async function editMessage(bot: Bot, channelId: bigint, messageId: bigint
}
return {
type: subcomponent.type,
custom_id: subcomponent.customId,
label: subcomponent.label,
style: subcomponent.style,
emoji: "emoji" in subcomponent && subcomponent.emoji
type: subComponent.type,
custom_id: subComponent.customId,
label: subComponent.label,
style: subComponent.style,
emoji: "emoji" in subComponent && subComponent.emoji
? {
id: subcomponent.emoji.id?.toString(),
name: subcomponent.emoji.name,
animated: subcomponent.emoji.animated,
id: subComponent.emoji.id?.toString(),
name: subComponent.emoji.name,
animated: subComponent.emoji.animated,
}
: undefined,
url: "url" in subcomponent ? subcomponent.url : undefined,
disabled: "disabled" in subcomponent ? subcomponent.disabled : undefined,
url: "url" in subComponent ? subComponent.url : undefined,
disabled: "disabled" in subComponent ? subComponent.disabled : undefined,
};
}),
})),
@@ -98,7 +98,7 @@ export interface EditMessage {
content?: string | null;
/** Embedded `rich` content (up to 6000 characters) */
embeds?: Embed[] | null;
/** Edit the flags of the message (only `SUPRESS_EMBEDS` can currently be set/unset) */
/** Edit the flags of the message (only `SUPPRESS_EMBEDS` can currently be set/unset) */
flags?: 4 | null;
/** The contents of the file being sent/edited */
file?: FileContent | FileContent[] | null;
+26 -26
View File
@@ -25,27 +25,27 @@ export async function sendMessage(bot: Bot, channelId: bigint, content: CreateMe
file: content.file,
components: content.components?.map((component) => ({
type: component.type,
components: component.components.map((subcomponent) => {
if (subcomponent.type === MessageComponentTypes.InputText) {
components: component.components.map((subComponent) => {
if (subComponent.type === MessageComponentTypes.InputText) {
return {
type: subcomponent.type,
style: subcomponent.style,
custom_id: subcomponent.customId,
label: subcomponent.label,
placeholder: subcomponent.placeholder,
min_length: subcomponent.minLength ?? subcomponent.required === false ? 0 : subcomponent.minLength,
max_length: subcomponent.maxLength,
type: subComponent.type,
style: subComponent.style,
custom_id: subComponent.customId,
label: subComponent.label,
placeholder: subComponent.placeholder,
min_length: subComponent.minLength ?? subComponent.required === false ? 0 : subComponent.minLength,
max_length: subComponent.maxLength,
};
}
if (subcomponent.type === MessageComponentTypes.SelectMenu) {
if (subComponent.type === MessageComponentTypes.SelectMenu) {
return {
type: subcomponent.type,
custom_id: subcomponent.customId,
placeholder: subcomponent.placeholder,
min_values: subcomponent.minValues,
max_values: subcomponent.maxValues,
options: subcomponent.options.map((option) => ({
type: subComponent.type,
custom_id: subComponent.customId,
placeholder: subComponent.placeholder,
min_values: subComponent.minValues,
max_values: subComponent.maxValues,
options: subComponent.options.map((option) => ({
label: option.label,
value: option.value,
description: option.description,
@@ -62,19 +62,19 @@ export async function sendMessage(bot: Bot, channelId: bigint, content: CreateMe
}
return {
type: subcomponent.type,
custom_id: subcomponent.customId,
label: subcomponent.label,
style: subcomponent.style,
emoji: "emoji" in subcomponent && subcomponent.emoji
type: subComponent.type,
custom_id: subComponent.customId,
label: subComponent.label,
style: subComponent.style,
emoji: "emoji" in subComponent && subComponent.emoji
? {
id: subcomponent.emoji.id?.toString(),
name: subcomponent.emoji.name,
animated: subcomponent.emoji.animated,
id: subComponent.emoji.id?.toString(),
name: subComponent.emoji.name,
animated: subComponent.emoji.animated,
}
: undefined,
url: "url" in subcomponent ? subcomponent.url : undefined,
disabled: "disabled" in subcomponent ? subcomponent.disabled : undefined,
url: "url" in subComponent ? subComponent.url : undefined,
disabled: "disabled" in subComponent ? subComponent.disabled : undefined,
};
}),
})),