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
@@ -42,27 +42,27 @@ export async function editInteractionResponse(
})),
components: options.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,
@@ -79,19 +79,19 @@ export async function editInteractionResponse(
}
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,
};
}),
})),