Skip to content

Commit

Permalink
Update Login Command (move to Native Function)
Browse files Browse the repository at this point in the history
  • Loading branch information
exatombe committed Jan 1, 2024
1 parent fd72c3c commit c0352d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion src/bot/commands/ai/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default async function Login(command: CommandsBase, interaction: CommandI
dispose: true,
})

let token = command.client.getModalValue("token", modal);
let token = modal.fields.getTextInputValue("token")
if (!token) {
return modal.reply({
content: "Vous devez entrer un token",
Expand Down
16 changes: 0 additions & 16 deletions src/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,6 @@ export default class Bot extends Client {
return encrypted.toString('hex') + ":" + iv.toString('hex');
};

getModalValue(key: string, modal: ModalSubmitInteraction){
let component = modal.components.find((component) => {
return component.components.find((subComponent) => {
return subComponent.customId === key;
});
})
if(!component) return undefined;
let subComponent = component.components.find((subComponent) => {
return subComponent.customId === key;
});
if(!subComponent) return undefined;
let value = subComponent.value;
if(!value) return undefined;
return value;
}

}


0 comments on commit c0352d6

Please sign in to comment.