Skip to content

Commit

Permalink
refactor(requestmanager): use timestampfrom (#7459)
Browse files Browse the repository at this point in the history
  • Loading branch information
muchnameless committed Feb 15, 2022
1 parent 2d2de1d commit 3298510
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/rest/src/lib/RequestManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ export class RequestManager extends EventEmitter {
// https://github.com/discord/discord-api-docs/issues/1295
if (method === RequestMethod.Delete && baseRoute === '/channels/:id/messages/:id') {
const id = /\d{16,19}$/.exec(endpoint)![0];
const snowflake = DiscordSnowflake.deconstruct(id);
if (Date.now() - Number(snowflake.timestamp) > 1000 * 60 * 60 * 24 * 14) {
const timestamp = DiscordSnowflake.timestampFrom(id);
if (Date.now() - timestamp > 1000 * 60 * 60 * 24 * 14) {
exceptions += '/Delete Old Message';
}
}
Expand Down

0 comments on commit 3298510

Please sign in to comment.