From 78eeee084f8f81d60579c3d5c87a0ca2efc1cb82 Mon Sep 17 00:00:00 2001 From: Guichaguri Date: Wed, 9 Dec 2015 23:41:31 -0200 Subject: [PATCH] Added user-agent with discord.js information Requested by the Discord Team --- src/Client/InternalClient.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index 21dd463d6..bb458c423 100644 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -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) {