diff --git a/src/class/AccountUtil.ts b/src/class/AccountUtil.ts index 0f41a07..d528e5b 100644 --- a/src/class/AccountUtil.ts +++ b/src/class/AccountUtil.ts @@ -70,10 +70,10 @@ export default class AccountUtil { `, }); - const guild = await this.client.guilds.cache.get('446067825673633794'); - const member = await guild.members.cache.get(data.userID); - member.roles.add('546457886440685578'); - const user = await this.client.users.cache.get(data.userID); + const guild = this.client.guilds.cache.get('446067825673633794'); + const member = guild.members.cache.get(data.userID); + await member.roles.add('546457886440685578'); + const user = this.client.users.cache.get(data.userID); user.send('<:loc:607695848612167700> **Thank you for creating an account with us!** <:loc:607695848612167700>\n' + `Please log into your account by running \`ssh ${data.username}@cloud.libraryofcode.org\` in your terminal, then use the password \`${tempPass}\` to log in.\n` + `You will be asked to change your password, \`(current) UNIX password\` is \`${tempPass}\`, then create a password that is at least 12 characters long, with at least one number, special character, and an uppercase letter\n` diff --git a/src/class/Util.ts b/src/class/Util.ts index 69ef48e..5e9f2f2 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -221,9 +221,9 @@ export default class Util { this.exec(`deluser ${username} --remove-home --backup-to /management/Archives && rm -rf -R ${account.homepath}`), this.client.db.Account.deleteOne({ username }), ]; - const guild = await this.client.guilds.cache.get('446067825673633794'); + const guild = this.client.guilds.cache.get('446067825673633794'); const member = await guild.members.fetch(account.userID); - member.roles.remove('546457886440685578', 'Cloud Account Deleted'); + await member.roles.remove('546457886440685578', 'Cloud Account Deleted'); // @ts-ignore await Promise.all(tasks); } @@ -304,7 +304,7 @@ export default class Util { .setTimestamp(); if (reason) embed.addField('Reason', reason || 'Not specified'); if (type === 2) embed.addField('Lock Expiration', `${date ? moment(date).format('dddd, MMMM Do YYYY, h:mm:ss A') : 'Indefinitely'}`); - const ch = await this.client.channels.cache.get('580950455581147146') as TextChannel; + const ch = this.client.channels.cache.get('580950455581147146') as TextChannel; ch.send({ embeds: [embed] }); this.client.users.fetch(userID).then((channel) => channel.send({ embeds: [embed] })).catch(); diff --git a/src/commands/applyt2.ts b/src/commands/applyt2.ts index 40cbf07..8a62445 100644 --- a/src/commands/applyt2.ts +++ b/src/commands/applyt2.ts @@ -42,7 +42,7 @@ export default class ApplyT2 extends Command { embed.setFooter(this.client.user.username, this.client.user.avatarURL()); embed.setTimestamp(); await this.client.util.sendMessageToUserTerminal(account.username, 'A technician has changed your tier to 2').catch(() => { }); - const ch = await this.client.channels.cache.get('580950455581147146') as TextChannel; + const ch = this.client.channels.cache.get('580950455581147146') as TextChannel; ch.send({ embeds: [embed] }); return this.client.users.fetch(account.userID).then((channel) => channel.send({ embeds: [embed] })).catch(); } diff --git a/src/commands/cwg_delete.ts b/src/commands/cwg_delete.ts index 4ab2015..12cc9a7 100644 --- a/src/commands/cwg_delete.ts +++ b/src/commands/cwg_delete.ts @@ -51,7 +51,7 @@ export default class CWG_Delete extends Command { await this.client.db.Domain.deleteOne({ domain: domain.domain }); await this.client.util.exec('systemctl reload nginx'); edit.edit(`***${this.client.stores.emojis.success} Domain ${domain.domain} with port ${domain.port} has been successfully deleted.***`); - const ch = await this.client.channels.cache.get('580950455581147146') as TextChannel; + const ch = this.client.channels.cache.get('580950455581147146') as TextChannel; ch.send({ embeds: [embed] }); return this.client.users.fetch(domain.account.userID).then((u) => u.send({ embeds: [embed] })).catch(() => {}); } catch (error) { diff --git a/src/commands/notify.ts b/src/commands/notify.ts index 20565ce..76d69d9 100644 --- a/src/commands/notify.ts +++ b/src/commands/notify.ts @@ -27,7 +27,7 @@ export default class Notify extends Command { u.send({ embeds: [embed] }); }); embed.addField('User', `${account.username} | <@${account.userID}>`, true); - const ch = await this.client.channels.cache.get('580950455581147146') as TextChannel; + const ch = this.client.channels.cache.get('580950455581147146') as TextChannel; ch.send({ embeds: [embed] }); this.client.util.transport.sendMail({ to: account.emailAddress, diff --git a/src/commands/tier.ts b/src/commands/tier.ts index 3869b15..b9f99dc 100644 --- a/src/commands/tier.ts +++ b/src/commands/tier.ts @@ -37,7 +37,7 @@ export default class Tier extends Command { embed.setFooter(this.client.user.username, this.client.user.avatarURL()); embed.setTimestamp(); await this.client.util.sendMessageToUserTerminal(account.username, `A technician has changed your tier to ${args[1]}`).catch(() => { }); - const ch = await this.client.channels.cache.get('580950455581147146') as TextChannel; + const ch = this.client.channels.cache.get('580950455581147146') as TextChannel; ch.send({ embeds: [embed] }); return this.client.users.fetch(account.userID).then((u) => u.send({ embeds: [embed] })).catch(); } catch (error) {