http rewrite (actually works this time!!1!) (#1257)

* rewrite http

* browser fun

* all the mimes dammit

* i need a newline

* whoops

* forgot about this

* use promises and HTTPRequest.method

* fluent

* move httpclient to external module

* branding

* middleware

* revert middleware
This commit is contained in:
Gus Caplan
2017-04-01 02:04:01 -05:00
committed by Crawl
parent a4e0af2e45
commit cb3f6d9646
5 changed files with 18 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
const superagent = require('superagent');
const snekfetch = require('snekfetch');
const Constants = require('./Constants');
/**
@@ -54,7 +54,7 @@ class Util {
static fetchRecommendedShards(token, guildsPerShard = 1000) {
return new Promise((resolve, reject) => {
if (!token) throw new Error('A token must be provided.');
superagent.get(Constants.Endpoints.gateway.bot)
snekfetch.get(Constants.Endpoints.gateway.bot)
.set('Authorization', `Bot ${token.replace(/^Bot\s*/i, '')}`)
.end((err, res) => {
if (err) reject(err);