forked from engineering/cloudservices
Merge branch 'master' of gitlab.libraryofcode.org:engineering/cloudservices-rewrite
commit
dd0468dc9c
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -59,7 +59,7 @@ export default class CWG extends Command {
|
|||
<strong>Port:</strong> ${domain.port}
|
||||
<strong>Certificate Issuer:</strong> ${cert.issuer.organizationName}
|
||||
<strong>Certificate Subject:</strong> ${cert.subject.commonName}
|
||||
<strong>Responsible Engineer</strong> ${message.author.username}#${message.author.discriminator}
|
||||
<strong>Responsible Engineer:</strong> ${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.
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue