From 5ec91d6728d073f52581688a2e75839cca14389b Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 18 Apr 2017 20:46:57 +0000 Subject: [PATCH] superagent is better --- README.md | 4 +-- commands/games/quiz.js | 4 +-- commands/random/strawpoll.js | 57 ++++++++++++++++++++++++++++++++++++ commands/random/today.js | 7 +++-- commands/search/botinfo.js | 4 +-- commands/search/define.js | 4 +-- commands/search/forecast.js | 4 +-- commands/search/google.js | 4 +-- commands/search/imdb.js | 4 +-- commands/search/map.js | 4 +-- commands/search/neopet.js | 4 +-- commands/search/osu.js | 4 +-- commands/search/urban.js | 4 +-- commands/search/wattpad.js | 4 +-- commands/search/weather.js | 4 +-- commands/search/wikipedia.js | 4 +-- commands/search/youtube.js | 4 +-- commands/search/yugioh.js | 4 +-- commands/textedit/webhook.js | 4 +-- commands/util/info.js | 6 ++-- html/carbondesc.html | 3 +- html/carbonfeat.html | 1 + html/discordbots.html | 4 ++- index.js | 10 +++---- package.json | 4 +-- 25 files changed, 111 insertions(+), 49 deletions(-) create mode 100644 commands/random/strawpoll.js diff --git a/README.md b/README.md index e3958c9e..7aa5844f 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ You can add XiaoBot to your server with [this link](https://discordapp.com/oauth You can join the home server with [this link](https://discord.gg/fqQF8mc). ## Modules -[discord.js](https://discord.js.org/#/), [commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [snekfetch](https://github.com/GusCaplan/snekfetch), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/) +[discord.js](https://discord.js.org/#/), [commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/) ## APIs -[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/) +[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API) ## Self-Hosting You can Self-Host the bot easily, provided you have API keys and a Discord Bot Token. [Node.js](https://nodejs.org/en/) is also required, with at least version 7.8.0 recommended. diff --git a/commands/games/quiz.js b/commands/games/quiz.js index c3d65723..65866d15 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class QuizCommand extends Command { constructor(client) { @@ -22,7 +22,7 @@ module.exports = class QuizCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } try { - const response = await snekfetch + const response = await request .get('http://jservice.io/api/random?count=1'); const data = response.body[0]; const answer = data.answer.toLowerCase().replace(/(|<\/i>)/g, ''); diff --git a/commands/random/strawpoll.js b/commands/random/strawpoll.js new file mode 100644 index 00000000..e15d9b97 --- /dev/null +++ b/commands/random/strawpoll.js @@ -0,0 +1,57 @@ +const { Command } = require('discord.js-commando'); +const request = require('superagent'); + +module.exports = class StrawpollCommand extends Command { + constructor(client) { + super(client, { + name: 'strawpoll', + aliases: [ + 'poll', + 'survey' + ], + group: 'random', + memberName: 'strawpoll', + description: 'Creates a Strawpoll with your options. (;strawpoll "Who likes chips?" "Me" "Not Me")', + examples: [';strawpoll "Who likes chips?" "Me" "Not Me"'], + args: [{ + key: 'title', + prompt: 'What would you like the title of the Strawpoll to be?', + type: 'string', + validate: title => { + if (title.length > 200) { + return 'Please limit your title to 200 characters.'; + } + return true; + } + }, { + key: 'choices', + prompt: 'What choices do you want me pick from?', + type: 'string', + infinite: true + }] + }); + } + + async run(message, args) { + if (message.channel.type !== 'dm') { + if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; + } + const title = args.title; + const choices = args.choices; + if (choices.length < 2) return message.say(':x: Error! You provided less than two choices!'); + if (choices.length > 31) return message.say(':x: Error! You provided more than thirty choices!'); + try { + const response = await request + .post('https://strawpoll.me/api/v2/polls') + .send({ + title: title, + options: choices + }); + const data = response.body; + return message.say(`${data.title}\nhttp://strawpoll.me/${data.id}`); + } + catch (err) { + return message.say(':x: Error! Something went wrong!'); + } + } +}; diff --git a/commands/random/today.js b/commands/random/today.js index 39acb846..4bb0214d 100644 --- a/commands/random/today.js +++ b/commands/random/today.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class TodayCommand extends Command { constructor(client) { @@ -22,8 +22,9 @@ module.exports = class TodayCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } try { - const response = await snekfetch - .get('http://history.muffinlabs.com/date'); + const response = await request + .get('http://history.muffinlabs.com/date') + .buffer(true); const parsedResponse = JSON.parse(response.text); const events = parsedResponse.data.Events; const randomNumber = Math.floor(Math.random() * events.length); diff --git a/commands/search/botinfo.js b/commands/search/botinfo.js index 3db02b0a..8d90d6cc 100644 --- a/commands/search/botinfo.js +++ b/commands/search/botinfo.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class BotSearchCommand extends Command { constructor(client) { @@ -29,7 +29,7 @@ module.exports = class BotSearchCommand extends Command { } const bot = args.bot.id; try { - const response = await snekfetch + const response = await request .get(`https://bots.discord.pw/api/bots/${bot}`) .set({ 'Authorization': process.env.DISCORD_BOTS_KEY diff --git a/commands/search/define.js b/commands/search/define.js index d73b7110..05442130 100644 --- a/commands/search/define.js +++ b/commands/search/define.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class DefineCommand extends Command { constructor(client) { @@ -31,7 +31,7 @@ module.exports = class DefineCommand extends Command { } const word = encodeURIComponent(args.word); try { - const response = await snekfetch + const response = await request .get(`http://api.wordnik.com:80/v4/word.json/${word}/definitions?limit=1&includeRelated=false&useCanonical=false&api_key=${process.env.WORDNIK_KEY}`); const data = response.body[0]; const embed = new RichEmbed() diff --git a/commands/search/forecast.js b/commands/search/forecast.js index abd21695..37f15958 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class ForecastCommand extends Command { constructor(client) { @@ -28,7 +28,7 @@ module.exports = class ForecastCommand extends Command { } const location = args.locationQ; try { - const response = await snekfetch + const response = await request .get(`https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where u=\'f\' AND woeid in (select woeid from geo.places(1) where text="${location}")&format=json`); const info = response.body.query.results.channel; const data = info.item.forecast; diff --git a/commands/search/google.js b/commands/search/google.js index 8ffdb293..a07c960b 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -1,5 +1,5 @@ const { Command } = require('discord.js-commando'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); const cheerio = require('cheerio'); const querystring = require('querystring'); @@ -29,7 +29,7 @@ module.exports = class GoogleCommand extends Command { const query = encodeURIComponent(args.query); const msg = await message.say('Searching...'); try { - const response = await snekfetch + const response = await request .get(`https://www.google.com/search?q=${query}`); const $ = cheerio.load(response.text); let href = $('.r').first().find('a').first().attr('href'); diff --git a/commands/search/imdb.js b/commands/search/imdb.js index cdc41dec..6b8c9b9f 100644 --- a/commands/search/imdb.js +++ b/commands/search/imdb.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class IMDBCommand extends Command { constructor(client) { @@ -30,7 +30,7 @@ module.exports = class IMDBCommand extends Command { } const movie = encodeURIComponent(args.movie); try { - const response = await snekfetch + const response = await request .get(`http://www.omdbapi.com/?t=${movie}&plot=full`); const data = response.body; const embed = new RichEmbed() diff --git a/commands/search/map.js b/commands/search/map.js index 156f4899..109444b3 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -1,5 +1,5 @@ const { Command } = require('discord.js-commando'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class MapCommand extends Command { constructor(client) { @@ -38,7 +38,7 @@ module.exports = class MapCommand extends Command { const zoom = args.zoom; const location = encodeURIComponent(args.locationQ); try { - const response = await snekfetch + const response = await request .get(`https://maps.googleapis.com/maps/api/staticmap?center=${location}&zoom=${zoom}&size=500x500&key=${process.env.GOOGLE_KEY}`); return message.channel.send({file: {attachment: response.body}}); } catch (err) { diff --git a/commands/search/neopet.js b/commands/search/neopet.js index e1644212..9bfaf8ee 100644 --- a/commands/search/neopet.js +++ b/commands/search/neopet.js @@ -1,5 +1,5 @@ const { Command } = require('discord.js-commando'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); const cheerio = require('cheerio'); module.exports = class NeopetCommand extends Command { @@ -25,7 +25,7 @@ module.exports = class NeopetCommand extends Command { } const pet = encodeURIComponent(args.pet); try { - const response = await snekfetch + const response = await request .get(`http://www.sunnyneo.com/petimagefinder.php?name=${pet}&size=5&mood=1`); const $ = cheerio.load(response.text); const link = $('textarea').first().text(); diff --git a/commands/search/osu.js b/commands/search/osu.js index b591159a..eb62a433 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class OsuCommand extends Command { constructor(client) { @@ -30,7 +30,7 @@ module.exports = class OsuCommand extends Command { } const username = encodeURIComponent(args.username); try { - const response = await snekfetch + const response = await request .get(`https://osu.ppy.sh/api/get_user?k=${process.env.OSU_KEY}&u=${username}&type=string`); const data = response.body[0]; const embed = new RichEmbed() diff --git a/commands/search/urban.js b/commands/search/urban.js index 915b0b2e..31057cc9 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class UrbanCommand extends Command { constructor(client) { @@ -30,7 +30,7 @@ module.exports = class UrbanCommand extends Command { } const word = encodeURIComponent(args.word); try { - const response = await snekfetch + const response = await request .get(`http://api.urbandictionary.com/v0/define?term=${word}`); const data = response.body.list[0]; const embed = new RichEmbed() diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index 23c54c08..8b021b11 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class WattpadCommand extends Command { constructor(client) { @@ -25,7 +25,7 @@ module.exports = class WattpadCommand extends Command { } const book = encodeURIComponent(args.book); try { - const response = await snekfetch + const response = await request .get(`https://api.wattpad.com:443/v4/stories?query=${book}&limit=1`) .set({ 'Authorization': `Basic ${process.env.WATTPAD_KEY}` diff --git a/commands/search/weather.js b/commands/search/weather.js index af6c8e16..6b87eed8 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class WeatherCommand extends Command { constructor(client) { @@ -25,7 +25,7 @@ module.exports = class WeatherCommand extends Command { } const location = args.locationQ; try { - const response = await snekfetch + const response = await request .get(`https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where u=\'f\' AND woeid in (select woeid from geo.places(1) where text="${location}")&format=json`); const data = response.body.query.results.channel; const embed = new RichEmbed() diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index ac28f184..4349e32b 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class WikipediaCommand extends Command { constructor(client) { @@ -26,7 +26,7 @@ module.exports = class WikipediaCommand extends Command { let query = encodeURIComponent(args.query); query = query.replace(/[)]/g, '%29'); try { - const response = await snekfetch + const response = await request .get(`https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=${query}&exintro=&explaintext=&redirects=&formatversion=2`); const data = response.body.query.pages[0]; const description = data.extract.substr(0, 1900).split('\n').join('\n\n'); diff --git a/commands/search/youtube.js b/commands/search/youtube.js index 1e9bd353..f8646c5b 100644 --- a/commands/search/youtube.js +++ b/commands/search/youtube.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class YouTubeCommand extends Command { constructor(client) { @@ -28,7 +28,7 @@ module.exports = class YouTubeCommand extends Command { } const video = encodeURIComponent(args.video); try { - const response = await snekfetch + const response = await request .get(`https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&maxResults=1&q=${video}&key=${process.env.GOOGLE_KEY}`); const data = response.body.items[0]; const embed = new RichEmbed() diff --git a/commands/search/yugioh.js b/commands/search/yugioh.js index 8bf02828..c7c599a5 100644 --- a/commands/search/yugioh.js +++ b/commands/search/yugioh.js @@ -1,6 +1,6 @@ const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class YuGiOhCommand extends Command { constructor(client) { @@ -25,7 +25,7 @@ module.exports = class YuGiOhCommand extends Command { } const card = encodeURIComponent(args.card); try { - const response = await snekfetch + const response = await request .get(`http://yugiohprices.com/api/card_data/${card}`); const data = response.body.data; if (data.card_type === 'monster') { diff --git a/commands/textedit/webhook.js b/commands/textedit/webhook.js index a3538028..ff2e4354 100644 --- a/commands/textedit/webhook.js +++ b/commands/textedit/webhook.js @@ -1,5 +1,5 @@ const { Command } = require('discord.js-commando'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); module.exports = class WebhookCommand extends Command { constructor(client) { @@ -34,7 +34,7 @@ module.exports = class WebhookCommand extends Command { const text = args.text; try { await message.delete(); - await snekfetch + await request .post(process.env.WEBHOOK_URL) .send({ content: text diff --git a/commands/util/info.js b/commands/util/info.js index bfc5d670..3df4c733 100644 --- a/commands/util/info.js +++ b/commands/util/info.js @@ -33,7 +33,7 @@ module.exports = class InfoCommand extends Command { .addField('Shards', `${this.client.options.shardCount} (${this.client.shard.id})`, true) .addField('Commands', - '106', true) + '107', true) .addField('Owner', 'dragonfire535#8081', true) .addField('Source Code', @@ -47,9 +47,9 @@ module.exports = class InfoCommand extends Command { .addField('Library', '[discord.js](https://discord.js.org/#/)', true) .addField('Modules', - '[commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [snekfetch](https://github.com/GusCaplan/snekfetch), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)') + '[commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)') .addField('APIs', - '[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Wikipedia](https://en.wikipedia.org/w/api.php), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/)'); + '[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Wikipedia](https://en.wikipedia.org/w/api.php), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API)'); return message.embed(embed); } }; diff --git a/html/carbondesc.html b/html/carbondesc.html index e9970947..80faf9ae 100644 --- a/html/carbondesc.html +++ b/html/carbondesc.html @@ -22,7 +22,7 @@
  • discord.js-commando
  • JIMP
  • zalgoize
  • -
  • snekfetch
  • +
  • superagent
  • mathjs
  • moment
  • moment-duration-format
  • @@ -44,6 +44,7 @@
  • Yahoo Weather
  • Wikipedia
  • Google Static Maps
  • +
  • Strawpoll
  • Information

    Information

    diff --git a/index.js b/index.js index f3cfc126..4a820bfe 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ const { CommandoClient } = require('discord.js-commando'); -const snekfetch = require('snekfetch'); +const request = require('superagent'); const path = require('path'); const client = new CommandoClient({ commandPrefix: 'x;', @@ -35,7 +35,7 @@ client.on('guildCreate', async(guild) => { const count = guilds.reduce((prev, val) => prev + val, 0); console.log(`[Count] ${count}`); try { - const response = await snekfetch + const response = await request .post('https://www.carbonitex.net/discord/data/botdata.php') .send({ key: process.env.CARBON_KEY, @@ -46,7 +46,7 @@ client.on('guildCreate', async(guild) => { console.log(`[Carbon] Failed to post to Carbon. ${err}`); } try { - const response = await snekfetch + const response = await request .post(`https://bots.discord.pw/api/bots/${client.user.id}/stats`) .set({ 'Authorization': process.env.DISCORD_BOTS_KEY @@ -66,7 +66,7 @@ client.on('guildDelete', async(guild) => { const count = guilds.reduce((prev, val) => prev + val, 0); console.log(`[Count] ${count}`); try { - const response = await snekfetch + const response = await request .post('https://www.carbonitex.net/discord/data/botdata.php') .send({ key: process.env.CARBON_KEY, @@ -77,7 +77,7 @@ client.on('guildDelete', async(guild) => { console.log(`[Carbon] Failed to post to Carbon. ${err}`); } try { - const response = await snekfetch + const response = await request .post(`https://bots.discord.pw/api/bots/${client.user.id}/stats`) .set({ 'Authorization': process.env.DISCORD_BOTS_KEY diff --git a/package.json b/package.json index 1bac34e4..4b077cc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "27.0.0", + "version": "28.0.0", "description": "A Discord Bot", "main": "shardingmanager.js", "scripts": { @@ -36,7 +36,7 @@ "mathjs": "^3.11.5", "moment": "^2.18.1", "moment-duration-format": "^1.3.0", - "snekfetch": "^2.3.2", + "superagent": "^3.5.2", "zalgolize": "^1.2.4" } }