mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 12:44:17 +02:00
feat(verification): add logging button presses
This commit is contained in:
parent
39c32101c5
commit
41c23ebb3c
@ -346,19 +346,39 @@ class VerificationJoinVCListener extends Listener {
|
|||||||
// Select roles
|
// Select roles
|
||||||
if (button.customId.includes('button')) {
|
if (button.customId.includes('button')) {
|
||||||
await button.deferUpdate();
|
await button.deferUpdate();
|
||||||
/*
|
// Get the button choice
|
||||||
const buttonChoice = button.customId.at(button.customId.length - 1);
|
const buttonChoice = this.getButtonValue(button.customId);
|
||||||
switch (buttonChoice) {
|
if (!isNaN(buttonChoice)) {
|
||||||
case 1: {
|
// Set the value of the button choice to the page the question was on
|
||||||
info.length = buttonChoice;
|
switch (info.page) {
|
||||||
break;
|
case 0: {
|
||||||
}
|
info.find.reason = buttonChoice;
|
||||||
case 2: {
|
break;
|
||||||
|
}
|
||||||
|
case 1: {
|
||||||
|
info.length = buttonChoice;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2: {
|
||||||
|
info.reasoning = buttonChoice;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3: {
|
||||||
|
info.life = buttonChoice;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4: {
|
||||||
|
info.food = buttonChoice;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
console.error('Button clicked out of range');
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
info.page += 1;
|
info.page += 1;
|
||||||
|
console.log(info);
|
||||||
// Checks if finished all the questions
|
// Checks if finished all the questions
|
||||||
if (info.page < questionLength) {
|
if (info.page < questionLength) {
|
||||||
embed = await this.createEmbed(questionInfo[info.page].question, embedColor);
|
embed = await this.createEmbed(questionInfo[info.page].question, embedColor);
|
||||||
@ -415,6 +435,15 @@ class VerificationJoinVCListener extends Listener {
|
|||||||
|
|
||||||
return buttonAction;
|
return buttonAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Finds the value of the choice in the butotn
|
||||||
|
private getButtonValue(button: string) {
|
||||||
|
const buttonChoice = button.at(button.length - 1);
|
||||||
|
if (buttonChoice === undefined) {
|
||||||
|
return NaN;
|
||||||
|
}
|
||||||
|
return parseInt(buttonChoice, 10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default VerificationJoinVCListener;
|
export default VerificationJoinVCListener;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user