mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 21:12:06 +00:00
Added user-agent with discord.js information
Requested by the Discord Team
This commit is contained in:
parent
4d0be3fc4c
commit
78eeee084f
1 changed files with 2 additions and 0 deletions
|
|
@ -22,10 +22,12 @@ import Invite from "../Structures/Invite";
|
|||
import VoiceConnection from "../Voice/VoiceConnection";
|
||||
|
||||
var zlib;
|
||||
var libVersion = require('../../package.json').version;
|
||||
|
||||
//todo: move this somewhere else
|
||||
var originalEnd = request.Request.prototype.end;
|
||||
request.Request.prototype.end = function(callback) {
|
||||
this.set('User-Agent', 'DiscordBot (https://github.com/hydrabolt/discord.js, ' + libVersion + ')');
|
||||
return new Promise((resolve, reject) => {
|
||||
originalEnd.call(this, (err, response) => {
|
||||
if (callback) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue