From bd343d19e04a33b5d88dd9df750b6e7659f1f00a Mon Sep 17 00:00:00 2001 From: Bsian Date: Mon, 21 Oct 2019 01:25:39 +0100 Subject: [PATCH 1/3] Added command exports cuz matt's lazy af --- src/commands/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands/index.ts b/src/commands/index.ts index 8e4b650..07817bd 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -1,3 +1,6 @@ export { default as Lock } from './lock'; export { default as Modlogs } from './modlogs'; export { default as Ping } from './ping'; +export { default as Announce } from './announce'; +export { default as CWG } from './cwg'; +export { default as Help } from './help'; From 07d639c82d10f76684b332d7f2d92b0c80014c71 Mon Sep 17 00:00:00 2001 From: Bsian Date: Mon, 21 Oct 2019 01:26:49 +0100 Subject: [PATCH 2/3] Added announce command --- src/commands/announce.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/commands/announce.ts diff --git a/src/commands/announce.ts b/src/commands/announce.ts new file mode 100644 index 0000000..2bf0af4 --- /dev/null +++ b/src/commands/announce.ts @@ -0,0 +1,28 @@ +import { Message } from 'eris'; +import { Client, config } from '..'; +import { Command } from '../class'; + +export default class Announce extends Command { + constructor(client: Client) { + super(client); + this.name = 'announce'; + this.description = 'Sends an announcement to all active terminals'; + this.usage = `${config.prefix}announce Hi there! | ${config.prefix}announce -e EMERGENCY!`; + this.aliases = ['ann']; + this.permissions = { roles: ['608095934399643649', '521312697896271873'] }; + this.enabled = true; + } + + public async run(message: Message, args?: string[]) { + try { + if (!args.length) return this.client.commands.get('help').run(message, [this.name]); + const notification = await message.channel.createMessage(`${this.client.stores.emojis.loading} ***Sending announcement, please wait...***`); + if (args[0] === '-e') await this.client.util.exec(`echo "\n\n**************************************************************************\nEMERGENCY SYSTEM BROADCAST MESSAGE | Library of Code sp-us (root enforced)\n--------------------------------------------------------------------------\n\n\n${args.slice(1).join(' ')}\n\n\n\n\n\n\n\n\n\n\n\n\n" | wall -n`); + else await this.client.util.exec(`echo "\nSYSTEM BROADCAST MESSAGE | Library of Code sp-us (root enforced)\n\n\n${args.join(' ')}" | wall -n`); + message.delete(); + return notification.edit(`${this.client.stores.emojis.success} ***Sent announcement to all active terminals***`); + } catch (error) { + return this.client.util.handleError(error, message, this); + } + } +} From e4abb5c61dfd71f3778c5b46785a1b721e021f64 Mon Sep 17 00:00:00 2001 From: Bsian Date: Mon, 21 Oct 2019 01:35:18 +0100 Subject: [PATCH 3/3] Added missing colon MATT --- src/commands/cwg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/cwg.ts b/src/commands/cwg.ts index b5a58b1..3d8fe1c 100644 --- a/src/commands/cwg.ts +++ b/src/commands/cwg.ts @@ -59,7 +59,7 @@ export default class CWG extends Command { Port: ${domain.port} Certificate Issuer: ${cert.issuer.organizationName} Certificate Subject: ${cert.subject.commonName} - Responsible Engineer ${message.author.username}#${message.author.discriminator} + Responsible Engineer: ${message.author.username}#${message.author.discriminator} If you have any questions about additional setup, you can reply to this email or send a message in #cloud-support in our Discord server. Thanks.