aboutsummaryrefslogtreecommitdiff
path: root/src/listeners
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-01 08:53:23 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-01 08:53:23 -0500
commite0ae0639d0b36c3cfd4065f791b95a32c1d7ea64 (patch)
tree46547b51ad50b0a7a73fbc848ad643f8736399ae /src/listeners
parentcbb68773614e44eb246e4cf2ff0d64d3e90f620f (diff)
downloadtanzanite-e0ae0639d0b36c3cfd4065f791b95a32c1d7ea64.tar.gz
tanzanite-e0ae0639d0b36c3cfd4065f791b95a32c1d7ea64.tar.bz2
tanzanite-e0ae0639d0b36c3cfd4065f791b95a32c1d7ea64.zip
added autocomplete to a few commands and performed some fixes
Diffstat (limited to 'src/listeners')
-rw-r--r--src/listeners/bush/nameAutoBan.ts36
-rw-r--r--src/listeners/commands/commandCooldown.ts4
2 files changed, 17 insertions, 23 deletions
diff --git a/src/listeners/bush/nameAutoBan.ts b/src/listeners/bush/nameAutoBan.ts
index dd702a5..0466ff0 100644
--- a/src/listeners/bush/nameAutoBan.ts
+++ b/src/listeners/bush/nameAutoBan.ts
@@ -1,12 +1,11 @@
import { AllowedMentions, BushListener, BushTextChannel, type BushClientEvents } from '#lib';
-import moment from 'moment';
export default class NameAutoBanListener extends BushListener {
public constructor() {
super('nameAutoBan', {
emitter: 'client',
event: 'guildMemberAdd',
- category: 'guild'
+ category: 'bush'
});
}
@@ -16,13 +15,6 @@ export default class NameAutoBanListener extends BushListener {
const guild = member.guild;
if (member.user.username === 'NotEnoughUpdates') {
- if (moment(member.user.createdAt).isBefore(moment().subtract(7, 'days'))) {
- return client.console.warn(
- 'nameAutoBan',
- `<<${member.user.tag}>> has not been banned because their account is older than 7 days.`
- );
- }
-
const res = await member.bushBan({
reason: "[AutoBan] 'NotEnoughUpdates' is a blacklisted name for this server.",
moderator: member.guild.me!
@@ -35,19 +27,21 @@ export default class NameAutoBanListener extends BushListener {
);
}
- await guild.sendLogChannel('automod', {
- embeds: [
- {
- title: 'Name Auto Ban',
- description: `**User:** ${member.user} (${member.user.tag})\n **Action:** Banned for using the blacklisted name 'NotEnoughUpdates'.`,
- color: client.consts.colors.red,
- author: {
- name: member.user.tag,
- iconURL: member.displayAvatarURL({ dynamic: true })
+ await guild
+ .sendLogChannel('automod', {
+ embeds: [
+ {
+ title: 'Name Auto Ban',
+ description: `**User:** ${member.user} (${member.user.tag})\n **Action:** Banned for using the blacklisted name 'NotEnoughUpdates'.`,
+ color: client.consts.colors.red,
+ author: {
+ name: member.user.tag,
+ iconURL: member.displayAvatarURL({ dynamic: true })
+ }
}
- }
- ]
- });
+ ]
+ })
+ .catch(() => {});
const content =
res === 'failed to dm'
diff --git a/src/listeners/commands/commandCooldown.ts b/src/listeners/commands/commandCooldown.ts
index 74f6a47..92b0abe 100644
--- a/src/listeners/commands/commandCooldown.ts
+++ b/src/listeners/commands/commandCooldown.ts
@@ -1,4 +1,4 @@
-import { BushListener, type BushCommandHandlerEvents, type BushMessage } from '#lib';
+import { BushListener, type BushCommandHandlerEvents } from '#lib';
export default class CommandCooldownListener extends BushListener {
public constructor() {
@@ -21,6 +21,6 @@ export default class CommandCooldownListener extends BushListener {
content: `⏳ This command is on cooldown for ${Math.round(remaining / 1000)} seconds.`,
ephemeral: true
})
- : await (message as BushMessage).react('⏳').catch(() => null);
+ : await message.react('⏳').catch(() => null);
}
}