From b6989333da2caf1de81231e67eef8f06d0ec3d5f Mon Sep 17 00:00:00 2001 From: Sophie M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Fri, 7 May 2021 10:50:08 -0500 Subject: [PATCH] Add addstatus.js --- commands/addstatus.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 commands/addstatus.js diff --git a/commands/addstatus.js b/commands/addstatus.js new file mode 100644 index 0000000..2469412 --- /dev/null +++ b/commands/addstatus.js @@ -0,0 +1,26 @@ +const { Message } = require('discord.js'); +const fs = require('fs'); +module.exports = { + name: 'addstatus', + description: 'Adds a new custom status to Anitrox', + async execute(message, args) { + const embed = { + "title": "<:AnitroxSuccess:809651936819019796> Status Added", + "color": 3585665, + "footer": { + "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": "Made with ❤ in Illinois | Anitrox by IDeletedSystem64" + }, + "fields": [ + { + "name": "Successfully added status!", + "value": "Added status " + args.slice(0,2) + } + ] + }; + const statuses = JSON.parse((await fs.promises.readFile('./statuses.json')).toString()) + statuses.push(args.slice(0,2)) + await fs.promises.writeFile('./statuses.json', JSON.stringify(ranges)); + Message.channel.send( {embed} ) + } + } \ No newline at end of file