mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 15:56:52 +02:00
Strawpoll API Removed
This commit is contained in:
@@ -16,7 +16,7 @@ You can join the home server with [this link](https://discord.gg/fqQF8mc).
|
||||
[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/)
|
||||
|
||||
## 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/), [Yoda Speak](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [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/), [Yoda Speak](https://market.mashape.com/ismaelc/yoda-speak), [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/)
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
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 snekfetch
|
||||
.post('https://strawpoll.me/api/v2/polls')
|
||||
.set({
|
||||
'Content-Type': 'application/json'
|
||||
})
|
||||
.send({
|
||||
title: title,
|
||||
options: choices
|
||||
});
|
||||
const data = response.body;
|
||||
console.log(response);
|
||||
console.log(title);
|
||||
console.log(choices);
|
||||
console.log(data);
|
||||
return message.say(`${data.title}\nhttp://strawpoll.me/${data.id}`);
|
||||
}
|
||||
catch (err) {
|
||||
return message.say(':x: Error! Something went wrong!');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -33,7 +33,7 @@ module.exports = class InfoCommand extends Command {
|
||||
.addField('Shards',
|
||||
`${this.client.options.shardCount} (${this.client.shard.id})`, true)
|
||||
.addField('Commands',
|
||||
'110', true)
|
||||
'109', true)
|
||||
.addField('Owner',
|
||||
'dragonfire535#8081', true)
|
||||
.addField('Source Code',
|
||||
@@ -49,7 +49,7 @@ module.exports = class InfoCommand extends Command {
|
||||
.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/)')
|
||||
.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/), [Yoda Speak](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [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/), [Yoda Speak](https://market.mashape.com/ismaelc/yoda-speak), [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/)');
|
||||
return message.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
<li><a href="https://bots.discord.pw/api">Discord Bots</a></li>
|
||||
<li><a href="http://history.muffinlabs.com/#api">Today in History</a></li>
|
||||
<li><a href="http://jservice.io/">jService</a></li>
|
||||
<li><a href="https://github.com/strawpoll/strawpoll/wiki/API">Strawpoll</a></li>
|
||||
<li><a href="https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation">Urban Dictionary</a></li>
|
||||
<li><a href="http://www.omdbapi.com/">OMDB</a></li>
|
||||
<li><a href="https://developer.yahoo.com/weather/">Yahoo Weather</a></li>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<li>Random Images (Cat, Pun, Potato, etc.)</li>
|
||||
<li>Magic 8 Ball</li>
|
||||
<li>Avatar Editing (RIP, Bob Ross, etc.)</li>
|
||||
<li>Make Strawpolls</li>
|
||||
<li>Meme Generator</li>
|
||||
<li>Math</li>
|
||||
<li>Typing and Math Games</li>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<li>Random Images (Cat, Pun, Potato, etc.)</li>
|
||||
<li>Magic 8 Ball</li>
|
||||
<li>Avatar Editing (RIP, Bob Ross, etc.)</li>
|
||||
<li>Make Strawpolls</li>
|
||||
<li>Meme Generator</li>
|
||||
<li>Math</li>
|
||||
<li>Typing and Math Games</li>
|
||||
@@ -83,7 +82,6 @@
|
||||
<li><a href="https://bots.discord.pw/api">Discord Bots</a></li>
|
||||
<li><a href="http://history.muffinlabs.com/#api">Today in History</a></li>
|
||||
<li><a href="http://jservice.io/">jService</a></li>
|
||||
<li><a href="https://github.com/strawpoll/strawpoll/wiki/API">Strawpoll</a></li>
|
||||
<li><a href="https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation">Urban Dictionary</a></li>
|
||||
<li><a href="http://www.omdbapi.com/">OMDB</a></li>
|
||||
<li><a href="https://developer.yahoo.com/weather/">Yahoo Weather</a></li>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "25.1.0",
|
||||
"version": "25.2.0",
|
||||
"description": "A Discord Bot",
|
||||
"main": "shardingmanager.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user