feat: remove nopecha

This commit is contained in:
Elysia
2023-04-06 19:29:25 +07:00
parent 00d6a6a88a
commit 34fb1df241
5 changed files with 7 additions and 31 deletions
+4
View File
@@ -70,6 +70,10 @@ class APIRequest {
if (this.options.auth !== false) headers.Authorization = this.rest.getAuth();
if (this.options.reason) headers['X-Audit-Log-Reason'] = encodeURIComponent(this.options.reason);
if (this.options.headers) headers = Object.assign(headers, this.options.headers);
// Delete all headers if undefined
for (const [key, value] of Object.entries(headers)) {
if (value === undefined) delete headers[key];
}
if (this.options.webhook === true) {
headers = {
'User-Agent': this.client.options.http.headers['User-Agent'],