mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Cleanup Part 2: Electric Boogaloo (Reloaded) (#594)
* Cleanup Part 2: Electric Boogaloo (Reloaded) * Moar cleanup * Tweak NOT_A_PERMISSION error
This commit is contained in:
committed by
Amish Shah
parent
5a9c42061f
commit
0b908f5bce
@@ -26,17 +26,12 @@ class APIRequest {
|
||||
|
||||
gen() {
|
||||
const apiRequest = request[this.method](this.url);
|
||||
if (this.auth) {
|
||||
apiRequest.set('authorization', this.getAuth());
|
||||
}
|
||||
if (this.auth) apiRequest.set('authorization', this.getAuth());
|
||||
if (this.file && this.file.file) {
|
||||
apiRequest.set('Content-Type', 'multipart/form-data');
|
||||
apiRequest.attach('file', this.file.file, this.file.name);
|
||||
}
|
||||
if (this.data) {
|
||||
apiRequest.send(this.data);
|
||||
}
|
||||
|
||||
if (this.data) apiRequest.send(this.data);
|
||||
apiRequest.set('User-Agent', this.rest.userAgentManager.userAgent);
|
||||
return apiRequest;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user