Is It Down Command

This commit is contained in:
Dragon Fire
2021-03-07 17:10:12 -05:00
parent 1c1daa2cc5
commit 8c934958c6
3 changed files with 46 additions and 2 deletions
+4 -1
View File
@@ -265,7 +265,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 615
Total: 616
### Utility:
@@ -574,6 +574,7 @@ Total: 615
* **gender:** Determines the gender of a name.
* **has-transparency:** Determines if an image has transparency in it.
* **image-size:** Determines the size of an image.
* **is-it-down:** Determines if a website is down or not.
* **ocr:** Performs Optical Character Recognition on an image.
* **parse-time:** Analyzes the time duration you provide and gives the result.
* **read-qr-code:** Reads a QR Code.
@@ -1403,6 +1404,8 @@ here.
* mindfulness (API)
- [ipify API](https://www.ipify.org/)
* ip (API)
- [Is It Down Right Now?](https://www.isitdownrightnow.com/)
* is-it-down (API)
- [iStock](https://www.istockphoto.com/)
* car-race ([Background Image](https://www.istockphoto.com/vector/side-view-of-a-road-with-a-crash-barrier-roadside-green-meadow-and-clear-blue-sky-gm1081596948-290039955))
- [Jack The Awesomeness Gamer](https://www.youtube.com/channel/UCIeA23B91hAeR1UuC2VDSdQ)
+41
View File
@@ -0,0 +1,41 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class IsItDownCommand extends Command {
constructor(client) {
super(client, {
name: 'is-it-down',
aliases: ['website-down', 'web-down', 'site-down', 'is-down'],
group: 'analyze',
memberName: 'is-it-down',
description: 'Determines if a website is down or not.',
credit: [
{
name: 'Is It Down Right Now?',
url: 'https://www.isitdownrightnow.com/',
reason: 'API'
}
],
args: [
{
key: 'url',
prompt: 'What URL do you want to test?',
type: 'string'
}
]
});
}
async run(msg, { url }) {
try {
const { text } = await request
.post('https://www.isitdownrightnow.com/check.php')
.query({ domain: url });
const down = text.includes('div class="statusdown"');
if (!down) return msg.reply('👍 This site is up and running.');
return msg.reply('👎 Looks like this site is down for everyone...');
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "131.9.0",
"version": "131.10.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {