send msgs to terminals on certain actions
parent
e1a7155cf5
commit
9092dfcae9
|
@ -20,6 +20,7 @@ export default class Lock extends Command {
|
|||
if (account.locked) return message.channel.createMessage(`***${this.client.stores.emojis.error} This account is already locked.***`);
|
||||
const edit = await message.channel.createMessage(`***${this.client.stores.emojis.loading} Locking account...***`);
|
||||
if (account.username === 'matthew' || account.root) return edit.edit(`***${this.client.stores.emojis.error} Permission denied.***`);
|
||||
await this.client.util.sendMessageToUserTerminal(account.username, 'ACCOUNT LOCKED BY TECHNICIAN | PREPARING TO LOGOUT').catch(() => { });
|
||||
await this.client.util.exec(`lock ${account.username}`);
|
||||
await account.updateOne({ locked: true });
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ export default class Notify extends Command {
|
|||
`,
|
||||
});
|
||||
message.delete();
|
||||
await this.client.util.sendMessageToUserTerminal(account.username, `NOTIFICATION FROM TECHNICIAN: ${args.slice(1).join(' ')}`).catch(() => { });
|
||||
return edit.edit(`***${this.client.stores.emojis.success} Send notification to ${account.username}.***`);
|
||||
} catch (error) {
|
||||
return this.client.util.handleError(error, message, this);
|
||||
|
|
|
@ -37,6 +37,7 @@ export default class Tier extends Command {
|
|||
embed.addField('Old Tier -> New Tier', `${account.tier} -> ${args[1]}`, true);
|
||||
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
||||
embed.setTimestamp();
|
||||
await this.client.util.sendMessageToUserTerminal(account.username, `A technician has upgraded your tier to ${args[1]}`).catch(() => { });
|
||||
this.client.createMessage('580950455581147146', { embed }); return this.client.getDMChannel(account.userID).then((channel) => channel.createMessage({ embed })).catch();
|
||||
} catch (error) {
|
||||
return this.client.util.handleError(error, message, this);
|
||||
|
|
|
@ -22,6 +22,7 @@ export default class Warn extends Command {
|
|||
await this.client.util.createModerationLog(account.userID, message.member, 1, args.slice(1).join(' '));
|
||||
message.delete();
|
||||
edit.edit(`***${this.client.stores.emojis.success} Account ${account.username} has been warned by Technician ${message.author.username}#${message.author.discriminator}.***`);
|
||||
await this.client.util.sendMessageToUserTerminal(account.username, `WARNING FROM TECHNICIAN: ${args.slice(1).join(' ')}`).catch(() => { });
|
||||
return this.client.util.transport.sendMail({
|
||||
to: account.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
|
|
|
@ -31,6 +31,7 @@ export default function memory(client: Client) {
|
|||
*/
|
||||
if ((memoryConversion >= userLimits.hard) && set.has(acc.username)) {
|
||||
client.signale.info(`RAM Hard Limit Reached | ${acc.username} | ${memoryConversion}/${userLimits.hard} MB`);
|
||||
await client.util.sendMessageToUserTerminal(acc.username, 'REACHED RAM LIMIT; SENDING KILL SIGNAL');
|
||||
client.util.exec(`killall -9 -u ${acc.username}`);
|
||||
const embed = new RichEmbed();
|
||||
embed.setTitle('Resource Enforcement Notification');
|
||||
|
@ -83,6 +84,7 @@ export default function memory(client: Client) {
|
|||
client.getDMChannel(acc.userID).then((channel) => {
|
||||
channel.createMessage({ embed: notifyEmbed });
|
||||
});
|
||||
await client.util.sendMessageToUserTerminal(acc.username, `You are about to reach your RAM resource limits, you are currently using '${String(Math.round(memoryConversion))} MB' and your limit is '${String(userLimits.hard)} MB'. Please correct your usage to avoid further action.`).catch(() => { });
|
||||
client.util.transport.sendMail({
|
||||
to: acc.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
|
|
Loading…
Reference in New Issue