value of autocomplete gets lost after switching to other channel and back

I have encountered an issue where the value of my autoselect gets lost in the execute method after i switch to another channel and then execute the command Autocomplete code
if (focusedOption.name === optionNames.date) {
for (let i = 0; i < 14; i++) {
const date = dayjs().utc().add(i, 'day')
choices.push({name: `${date.format('dddd DD.MM.YYYY')}`, value: `${date.toDate()}`});
}
}
if (focusedOption.name === optionNames.date) {
for (let i = 0; i < 14; i++) {
const date = dayjs().utc().add(i, 'day')
choices.push({name: `${date.format('dddd DD.MM.YYYY')}`, value: `${date.toDate()}`});
}
}
result when i switch the channel while the command is in autocomplete mode selectedDate: Sunday 20.10.2024 (this is basically my name: property) result when i dont switch the channel which should be always my expected result selectedDate: Mon Oct 21 2024 14:48:56 GMT+0200 (Mitteleuropäische Sommerzeit) can someone help me here?
3 Replies
d.js toolkit
d.js toolkit5w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Kinect3000
Kinect30005w ago
What was the error? Oh, ur saying you get the name instead of value Yea, that would be a Discord app issue then, not D.js
d.js docs
d.js docs5w ago
We are not Discord, just some nerds who develop Discord bots! - /report appeals and age updates - /howtoreport reports (harassment/hacking/spam/abuse) - /support anything Discord related - /billing payment/nitro - /feedback feedback/feature requests
Want results from more Discord servers?
Add your server