fix: ending uncached polls (#11157)

This commit is contained in:
Almeida
2025-10-08 22:04:05 +01:00
committed by GitHub
parent 230e746b31
commit 7f29356950

View File

@@ -179,7 +179,7 @@ class Poll extends Base {
* @returns {Promise<Message>} * @returns {Promise<Message>}
*/ */
async end() { async end() {
if (Date.now() > this.expiresTimestamp) { if (this.expiresTimestamp !== null && Date.now() > this.expiresTimestamp) {
throw new DiscordjsError(ErrorCodes.PollAlreadyExpired); throw new DiscordjsError(ErrorCodes.PollAlreadyExpired);
} }