mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 16:19:12 +02:00
Would You Rather Command
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), [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/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API)
|
||||
[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), [rrrather](http://www.rrrather.com/botapi)
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const request = require('superagent');
|
||||
|
||||
module.exports = class WouldYouRatherCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'wouldyourather',
|
||||
aliases: [
|
||||
'would-you-rather',
|
||||
'wyrather'
|
||||
],
|
||||
group: 'random',
|
||||
memberName: 'wouldyourather',
|
||||
description: 'Gets a random would you rather question. (;wouldyourather)',
|
||||
examples: [';wouldyourather']
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
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 request
|
||||
.get('http://www.rrrather.com/botapi');
|
||||
const data = response.body;
|
||||
const embed = new RichEmbed()
|
||||
.setTitle(`${data.title}...`)
|
||||
.setURL(data.link)
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(`${data.choicea} OR ${data.choiceb}?`);
|
||||
return message.embed(embed);
|
||||
} 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',
|
||||
'107', true)
|
||||
'108', 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), [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/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API)');
|
||||
'[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), [rrrather](http://www.rrrather.com/botapi)');
|
||||
return message.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<li><a href="https://en.wikipedia.org/w/api.php">Wikipedia</a></li>
|
||||
<li><a href="https://developers.google.com/maps/documentation/static-maps/">Google Static Maps</a></li>
|
||||
<li><a href="https://github.com/strawpoll/strawpoll/wiki/API">Strawpoll</a></li>
|
||||
<li><a href="http://www.rrrather.com/botapi">rrrather</a></li>
|
||||
</ul>
|
||||
<h2>Information</h2>
|
||||
<ul>
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
<li><a href="https://en.wikipedia.org/w/api.php">Wikipedia</a></li>
|
||||
<li><a href="https://developers.google.com/maps/documentation/static-maps/">Google Static Maps</a></li>
|
||||
<li><a href="https://github.com/strawpoll/strawpoll/wiki/API">Strawpoll</a></li>
|
||||
<li><a href="http://www.rrrather.com/botapi">rrrather</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
<h2>Information</h2>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "28.0.1",
|
||||
"version": "28.1.0",
|
||||
"description": "A Discord Bot",
|
||||
"main": "shardingmanager.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user