Smilebasic command

This commit is contained in:
Dragon Fire
2020-06-15 12:51:37 -04:00
parent 594cc87272
commit c205921956
3 changed files with 45 additions and 2 deletions
+4 -1
View File
@@ -227,7 +227,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 486
Total: 487
### Utility:
@@ -755,6 +755,7 @@ Total: 486
* **portal-send:** Send a message to a portal channel.
* **prune:** Deletes up to 99 messages from the current channel.
* **rename-all:** Renames every member of the server. (Owner-Only)
* **smilebasic:** Responds with a ZIP file for a SmileBASIC project.
* **strawpoll:** Generates a Strawpoll with the options you provide.
### Roleplay:
@@ -1401,6 +1402,8 @@ here.
* brony-speak ([English-to-Brony Dictionary Data](https://www.deviantart.com/shrick/art/Brony-dictionary-version-2-207157029))
- [SinKillerJ Tachikawa](https://www.deviantart.com/sinkillerj)
* steam-card ([Template](https://www.deviantart.com/sinkillerj/art/Steam-Trading-Card-Template-GIMP-372156984))
- [SmileBASIC Source](https://smilebasicsource.com/)
* smilebasic ([API](https://smilebasicsource.com/page?pid=1360))
- [SMWiki](http://www.smwiki.net/)
* smw-level ([Level Name Data](http://old.smwiki.net/wiki/List_of_Super_Mario_World_levels))
- [Snapchat](https://www.snapchat.com/)
+40
View File
@@ -0,0 +1,40 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class SmilebasicCommand extends Command {
constructor(client) {
super(client, {
name: 'smilebasic',
group: 'other',
memberName: 'smilebasic',
description: 'Responds with a ZIP file for a SmileBASIC project.',
clientPermissions: ['ATTACH_FILES'],
credit: [
{
name: 'SmileBASIC Source',
url: 'https://smilebasicsource.com/',
reason: 'API',
reasonURL: 'https://smilebasicsource.com/page?pid=1360'
}
],
args: [
{
key: 'key',
prompt: 'What project key would you like to get a ZIP for?',
type: 'string',
parse: key => key.toUpperCase()
}
]
});
}
async run(msg, { key }) {
try {
const { body } = await request.get(`http://sbapi.me/get/${key}/zip`);
return msg.say({ files: [{ attachment: body, name: `${key}.zip` }] });
} catch (err) {
if (err.status === 404) return msg.say('Could not find any results. Invalid key?');
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "116.27.6",
"version": "116.28.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {