mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
refactor: use optional chaining (#6757)
This commit is contained in:
@@ -48,7 +48,7 @@ class APIRequest {
|
||||
if (this.options.headers) headers = Object.assign(headers, this.options.headers);
|
||||
|
||||
let body;
|
||||
if (this.options.files && this.options.files.length) {
|
||||
if (this.options.files?.length) {
|
||||
body = new FormData();
|
||||
for (const file of this.options.files) {
|
||||
if (file?.file) body.append(file.key ?? file.name, file.file, file.name);
|
||||
|
||||
@@ -177,7 +177,7 @@ class RequestHandler {
|
||||
}
|
||||
|
||||
let sublimitTimeout;
|
||||
if (res && res.headers) {
|
||||
if (res.headers) {
|
||||
const serverDate = res.headers.get('date');
|
||||
const limit = res.headers.get('x-ratelimit-limit');
|
||||
const remaining = res.headers.get('x-ratelimit-remaining');
|
||||
|
||||
Reference in New Issue
Block a user