aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-26 18:45:31 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-26 18:45:31 -0400
commitcca0b7a03bcd61af12b7f9bff51276f6c70beeb3 (patch)
tree2b2adebc166ac033520e5b582773e63fbdc5ddb9 /src/lib/extensions/discord.js
parent13ba1ad552047eb9386e91d542a975c4bef58b08 (diff)
downloadtanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.tar.gz
tanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.tar.bz2
tanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.zip
refactor: this.client.util -> util
Diffstat (limited to 'src/lib/extensions/discord.js')
-rw-r--r--src/lib/extensions/discord.js/BushGuild.ts4
-rw-r--r--src/lib/extensions/discord.js/BushGuildMember.ts28
2 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts
index 79f7c98..0e4891e 100644
--- a/src/lib/extensions/discord.js/BushGuild.ts
+++ b/src/lib/extensions/discord.js/BushGuild.ts
@@ -55,7 +55,7 @@ export class BushGuild extends Guild {
if (!unbanSuccess) return 'error unbanning';
// add modlog entry
- const modlog = await this.client.util
+ const modlog = await util
.createModLogEntry({
type: ModLogType.UNBAN,
user,
@@ -67,7 +67,7 @@ export class BushGuild extends Guild {
if (!modlog) return 'error creating modlog entry';
// remove punishment entry
- const removePunishmentEntrySuccess = await this.client.util
+ const removePunishmentEntrySuccess = await util
.removePunishmentEntry({
type: 'ban',
user,
diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts
index 50875cc..c04c8f0 100644
--- a/src/lib/extensions/discord.js/BushGuildMember.ts
+++ b/src/lib/extensions/discord.js/BushGuildMember.ts
@@ -82,7 +82,7 @@ export class BushGuildMember extends GuildMember {
public async warn(options: BushPunishmentOptions): Promise<{ result: WarnResponse; caseNum: number }> {
const moderator = this.client.users.cache.get(this.client.users.resolveId(options.moderator || this.client.user));
// add modlog entry
- const result = await this.client.util
+ const result = await util
.createModLogEntry(
{
type: ModLogType.WARN,
@@ -119,7 +119,7 @@ export class BushGuildMember extends GuildMember {
const moderator = this.client.users.cache.get(this.client.users.resolveId(options.moderator || this.client.user));
if (options.addToModlog) {
- const { log: modlog } = await this.client.util
+ const { log: modlog } = await util
.createModLogEntry({
type: options.duration ? ModLogType.TEMP_PUNISHMENT_ROLE : ModLogType.PERM_PUNISHMENT_ROLE,
guild: this.guild,
@@ -130,7 +130,7 @@ export class BushGuildMember extends GuildMember {
.catch(() => null);
if (!modlog) return 'error creating modlog entry';
- const punishmentEntrySuccess = await this.client.util
+ const punishmentEntrySuccess = await util
.createPunishmentEntry({
type: 'role',
user: this,
@@ -156,7 +156,7 @@ export class BushGuildMember extends GuildMember {
const moderator = this.client.users.cache.get(this.client.users.resolveId(options.moderator || this.client.user));
if (options.addToModlog) {
- const { log: modlog } = await this.client.util
+ const { log: modlog } = await util
.createModLogEntry({
type: ModLogType.PERM_PUNISHMENT_ROLE,
guild: this.guild,
@@ -167,7 +167,7 @@ export class BushGuildMember extends GuildMember {
.catch(() => null);
if (!modlog) return 'error creating modlog entry';
- const punishmentEntrySuccess = await this.client.util
+ const punishmentEntrySuccess = await util
.removePunishmentEntry({
type: 'role',
user: this,
@@ -212,7 +212,7 @@ export class BushGuildMember extends GuildMember {
if (!muteSuccess) return 'error giving mute role';
// add modlog entry
- const { log: modlog } = await this.client.util
+ const { log: modlog } = await util
.createModLogEntry({
type: options.duration ? ModLogType.TEMP_MUTE : ModLogType.PERM_MUTE,
user: this,
@@ -225,7 +225,7 @@ export class BushGuildMember extends GuildMember {
if (!modlog) return 'error creating modlog entry';
// add punishment entry so they can be unmuted later
- const punishmentEntrySuccess = await this.client.util
+ const punishmentEntrySuccess = await util
.createPunishmentEntry({
type: 'mute',
user: this,
@@ -240,7 +240,7 @@ export class BushGuildMember extends GuildMember {
const ending = await this.guild.getSetting('punishmentEnding');
const dmSuccess = await this.send({
content: `You have been muted ${
- options.duration ? 'for ' + this.client.util.humanizeDuration(options.duration) : 'permanently'
+ options.duration ? 'for ' + util.humanizeDuration(options.duration) : 'permanently'
} in **${this.guild}** for **${options.reason || 'No reason provided'}**.${ending ? `\n\n${ending}` : ''}`
}).catch(() => null);
@@ -267,7 +267,7 @@ export class BushGuildMember extends GuildMember {
if (!muteSuccess) return 'error removing mute role';
//remove modlog entry
- const { log: modlog } = await this.client.util
+ const { log: modlog } = await util
.createModLogEntry({
type: ModLogType.UNMUTE,
user: this,
@@ -279,7 +279,7 @@ export class BushGuildMember extends GuildMember {
if (!modlog) return 'error creating modlog entry';
// remove mute entry
- const removePunishmentEntrySuccess = await this.client.util
+ const removePunishmentEntrySuccess = await util
.removePunishmentEntry({
type: 'mute',
user: this,
@@ -317,7 +317,7 @@ export class BushGuildMember extends GuildMember {
if (!kickSuccess) return 'error kicking';
// add modlog entry
- const { log: modlog } = await this.client.util
+ const { log: modlog } = await util
.createModLogEntry({
type: ModLogType.KICK,
user: this,
@@ -341,7 +341,7 @@ export class BushGuildMember extends GuildMember {
const ending = await this.guild.getSetting('punishmentEnding');
const dmSuccess = await this.send({
content: `You have been banned ${
- options.duration ? 'for ' + this.client.util.humanizeDuration(options.duration) : 'permanently'
+ options.duration ? 'for ' + util.humanizeDuration(options.duration) : 'permanently'
} from **${this.guild}** for **${options.reason || 'No reason provided'}**.${ending ? `\n\n${ending}` : ''}`
}).catch(() => null);
@@ -353,7 +353,7 @@ export class BushGuildMember extends GuildMember {
if (!banSuccess) return 'error banning';
// add modlog entry
- const { log: modlog } = await this.client.util
+ const { log: modlog } = await util
.createModLogEntry({
type: options.duration ? ModLogType.TEMP_BAN : ModLogType.PERM_BAN,
user: this,
@@ -366,7 +366,7 @@ export class BushGuildMember extends GuildMember {
if (!modlog) return 'error creating modlog entry';
// add punishment entry so they can be unbanned later
- const punishmentEntrySuccess = await this.client.util
+ const punishmentEntrySuccess = await util
.createPunishmentEntry({
type: 'ban',
user: this,