problem with timeout

hey, when I want to check if a user is timeouted, when my bot restarts, my friend is timeouted but the bot thinks he isn't timeouted :/
5 Replies
Jaworek
Jaworek3y ago
u can fetch member
Chadoxi
ChadoxiOP3y ago
//const members = message.guild.members.cache.filter(m => m.isCommunicationDisabled())
const data = message.guild.members.cache.filter(m => m.isCommunicationDisabled()).map(mem => {
return {
time: Math.round(mem.communicationDisabledUntilTimestamp / 1000)
}
})
console.log(data)
//const members = message.guild.members.cache.filter(m => m.isCommunicationDisabled())
const data = message.guild.members.cache.filter(m => m.isCommunicationDisabled()).map(mem => {
return {
time: Math.round(mem.communicationDisabledUntilTimestamp / 1000)
}
})
console.log(data)
I have this but the problem I say imagine you're timeouted the bot know you're timeouted but if the bot restarts in the collection, the bot see any member timeouted its the problem
Jaworek
Jaworek3y ago
members arent cached by default fetch them
Chadoxi
ChadoxiOP3y ago
oh ok
const fetchmembers = message.guild.members.fetch()
console.log(fetchmembers)
const members = fetchmembers.filter(m => m.isCommunicationDisabled())
const fetchmembers = message.guild.members.fetch()
console.log(fetchmembers)
const members = fetchmembers.filter(m => m.isCommunicationDisabled())
like this? nvm I found I just need to make an embed
Jaworek
Jaworek3y ago
fetch returns promise
Want results from more Discord servers?
Add your server