mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +02:00
FML Command
This commit is contained in:
@@ -132,7 +132,7 @@ in the appropriate channel's topic to use it.
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Total: 400
|
Total: 401
|
||||||
|
|
||||||
### Utility:
|
### Utility:
|
||||||
|
|
||||||
@@ -180,6 +180,7 @@ Total: 400
|
|||||||
* **draw-cards:** Draws a random hand of playing cards.
|
* **draw-cards:** Draws a random hand of playing cards.
|
||||||
* **fact-core:** Responds with a random Fact Core quote.
|
* **fact-core:** Responds with a random Fact Core quote.
|
||||||
* **fact:** Responds with a random fact.
|
* **fact:** Responds with a random fact.
|
||||||
|
* **fml:** Responds with a FML quote. (NSFW)
|
||||||
* **fortune:** Responds with a random fortune.
|
* **fortune:** Responds with a random fortune.
|
||||||
* **github-zen:** Responds with a random GitHub design philosophy.
|
* **github-zen:** Responds with a random GitHub design philosophy.
|
||||||
* **joke:** Responds with a random joke.
|
* **joke:** Responds with a random joke.
|
||||||
@@ -742,6 +743,8 @@ here.
|
|||||||
* wikia ([API](https://www.wikia.com/api/v1/))
|
* wikia ([API](https://www.wikia.com/api/v1/))
|
||||||
- [Flickr](https://www.flickr.com/)
|
- [Flickr](https://www.flickr.com/)
|
||||||
* flickr ([API](https://www.flickr.com/services/api/))
|
* flickr ([API](https://www.flickr.com/services/api/))
|
||||||
|
- [FML](https://www.fmylife.com/)
|
||||||
|
* fml (FML Data)
|
||||||
- [Foreign exchange rates API](https://exchangeratesapi.io/)
|
- [Foreign exchange rates API](https://exchangeratesapi.io/)
|
||||||
* currency (API)
|
* currency (API)
|
||||||
- [Free SVG](https://freesvg.org/)
|
- [Free SVG](https://freesvg.org/)
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const request = require('node-superfetch');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = class FmlCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'fml',
|
||||||
|
aliases: ['fuck-my-life', 'f-my-life'],
|
||||||
|
group: 'random-res',
|
||||||
|
memberName: 'fml',
|
||||||
|
description: 'Responds with a FML quote.',
|
||||||
|
nsfw: true,
|
||||||
|
credit: [
|
||||||
|
{
|
||||||
|
name: 'FML',
|
||||||
|
url: 'https://www.fmylife.com/',
|
||||||
|
reason: 'FML Data'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(msg) {
|
||||||
|
try {
|
||||||
|
const { text } = await request.get('http://www.fmylife.com/random');
|
||||||
|
const $ = cheerio.load(text, { normalizeWhitespace: true });
|
||||||
|
const fml = $('a.article-link').first().text().trim();
|
||||||
|
return msg.say(fml);
|
||||||
|
} catch (err) {
|
||||||
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "113.14.0",
|
"version": "113.15.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user