fix #105
This commit is contained in:
		@@ -44,6 +44,9 @@ class APIRequest {
 | 
				
			|||||||
      'User-Agent': this.fullUserAgent,
 | 
					      'User-Agent': this.fullUserAgent,
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Edit UA
 | 
				
			||||||
 | 
					    this.client.options.http.headers['User-Agent'] = this.fullUserAgent;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (this.options.auth !== false) headers.Authorization = this.rest.getAuth();
 | 
					    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.reason) headers['X-Audit-Log-Reason'] = encodeURIComponent(this.options.reason);
 | 
				
			||||||
    if (this.options.headers) headers = Object.assign(headers, this.options.headers);
 | 
					    if (this.options.headers) headers = Object.assign(headers, this.options.headers);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -80,9 +80,9 @@ exports.localeObject = {
 | 
				
			|||||||
  'zh-TW': 'TAIWAN_CHINESE',
 | 
					  'zh-TW': 'TAIWAN_CHINESE',
 | 
				
			||||||
  ko: 'KOREAN',
 | 
					  ko: 'KOREAN',
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					// No used
 | 
				
			||||||
exports.UserAgent = listUserAgent[Math.floor(Math.random() * listUserAgent.length)];
 | 
					exports.UserAgent = listUserAgent[Math.floor(Math.random() * listUserAgent.length)];
 | 
				
			||||||
 | 
					// Useful
 | 
				
			||||||
exports.randomUA = () => listUserAgent[Math.floor(Math.random() * listUserAgent.length)];
 | 
					exports.randomUA = () => listUserAgent[Math.floor(Math.random() * listUserAgent.length)];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exports.WSCodes = {
 | 
					exports.WSCodes = {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -220,7 +220,7 @@ class Options extends null {
 | 
				
			|||||||
          ).toString('base64')}`,
 | 
					          ).toString('base64')}`,
 | 
				
			||||||
          'X-Discord-Locale': 'en-US',
 | 
					          'X-Discord-Locale': 'en-US',
 | 
				
			||||||
          Origin: 'https://discord.com',
 | 
					          Origin: 'https://discord.com',
 | 
				
			||||||
          'user-agent':
 | 
					          'User-Agent':
 | 
				
			||||||
            'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9004 Chrome/91.0.4472.164 Electron/13.6.6 Safari/537.36',
 | 
					            'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9004 Chrome/91.0.4472.164 Electron/13.6.6 Safari/537.36',
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        agent: {},
 | 
					        agent: {},
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user