我只是在寻找一种在机器人重启或崩溃后恢复超时的方法。 是否有任何节点包?还是任何方法?
我在Glitch上托管,因此该漫游器总是有重启的机会。 这是我的代码:
setTimeout(() => {
let users = m.reactions.get("?").users
let gFilter = users.filter(u => !u.bot).random()
giveEmbed.title = null
giveEmbed.description = null
giveEmbed.fields = [{
name: '? Giveaway Ended! ?',
value: `**Winner :** ${gFilter}\n**Prize :** ${title}`,
inline: false
}]
giveEmbed.timestamp = new Date()
giveEmbed.footer = ({
text: `Ended At`
})
if (!gFilter) {
giveEmbed.fields = [{
name: '? Giveaway Ended! ?',
value: `**Winner :** No Winner\n**Prize :** ${title}`,
inline: false
}]
m.edit('**? GIVEAWAY ENDED ? @everyone**', {
embed: giveEmbed
});
message.guild.channels.get(room.replace(/\D/g, '')).send(`**The Giveaway Ended With No Winner ?**`)
} else {
m.edit('**? GIVEAWAY ENDED ? @everyone**', {
embed: giveEmbed
});
message.guild.channels.get(room.replace(/\D/g, '')).send(`**Congratulations ${gFilter} ! You Won The __${title}__ !!! <a:crazy:526018890208116738>**`)
gFilter.send(`**Congratulations ${gFilter} ! You Won The __${title}__ !!! <a:crazy:526018890208116738>\nAsk for Your Prize In <#593334823230242817> <a:RainbowParrot:597540860934225960>**`)
}
}, ms(duration));