aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/config/config.ts6
-rw-r--r--src/commands/config/features.ts6
-rw-r--r--src/commands/info/guildInfo.ts2
-rw-r--r--src/commands/info/help.ts3
-rw-r--r--src/commands/info/links.ts2
-rw-r--r--src/commands/info/snowflake.ts2
-rw-r--r--src/commands/info/userInfo.ts6
-rw-r--r--src/commands/leveling/leaderboard.ts13
-rw-r--r--src/commands/leveling/level.ts12
-rw-r--r--src/commands/moderation/modlog.ts2
-rw-r--r--src/commands/moderation/unban.ts2
11 files changed, 36 insertions, 20 deletions
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts
index 6e7373c..3f1fc8c 100644
--- a/src/commands/config/config.ts
+++ b/src/commands/config/config.ts
@@ -240,10 +240,8 @@ export default class SettingsCommand extends BushCommand {
}
}
const collector = msg.createMessageComponentCollector({
- channel: message.channel ?? undefined,
- guild: message.guild,
- message: message as Message,
- time: 300_000
+ time: 300_000,
+ filter: (i) => i.guildId === message.guildId && i.message.id === message.id
});
collector.on('collect', async (interaction: MessageComponentInteraction) => {
diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts
index 8010ab9..743b243 100644
--- a/src/commands/config/features.ts
+++ b/src/commands/config/features.ts
@@ -28,11 +28,9 @@ export default class FeaturesCommand extends BushCommand {
const components = this.generateComponents(guildFeaturesArr, false);
const msg = (await message.util.reply({ embeds: [featureEmbed], components: [components] })) as Message;
const collector = msg.createMessageComponentCollector({
- channel: message.channel ?? undefined,
- guild: message.guild,
componentType: 'SELECT_MENU',
- message: message as Message,
- time: 300_000
+ time: 300_000,
+ filter: (i) => i.guildId === message.guildId && i.message.id === message.id
});
collector.on('collect', async (interaction: SelectMenuInteraction) => {
diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts
index f70b741..f1db783 100644
--- a/src/commands/info/guildInfo.ts
+++ b/src/commands/info/guildInfo.ts
@@ -105,7 +105,7 @@ export default class GuildInfoCommand extends BushCommand {
guildAbout.push(
`**Owner:** ${guild.members.cache.get(guild.ownerId)?.user.tag}`,
- `**Created** ${guild.createdAt.toLocaleString()} (${util.dateDelta(guild.createdAt)})`,
+ `**Created** ${util.timestamp(guild.createdAt)} (${util.dateDelta(guild.createdAt)})`,
`**Members:** ${guild.memberCount.toLocaleString() ?? 0} (${util.emojis.onlineCircle} ${
guild.approximatePresenceCount?.toLocaleString() ?? 0
}, ${util.emojis.offlineCircle} ${(guild.memberCount - (guild.approximatePresenceCount ?? 0)).toLocaleString() ?? 0})`,
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts
index 1338f8a..8c97ba8 100644
--- a/src/commands/info/help.ts
+++ b/src/commands/info/help.ts
@@ -1,7 +1,6 @@
import { BushCommand, BushMessage, BushSlashMessage } from '@lib';
import { MessageActionRow, MessageButton, MessageEmbed } from 'discord.js';
import packageDotJSON from '../../../package.json';
-
export default class HelpCommand extends BushCommand {
public constructor() {
super('help', {
@@ -61,7 +60,7 @@ export default class HelpCommand extends BushCommand {
label: 'Invite Me',
url: `https://discord.com/api/oauth2/authorize?client_id=${
client.user!.id
- }&permissions=2147483647&scope=bot%20applications.commands`
+ }&permissions=5368709119918&scope=bot%20applications.commands`
})
);
}
diff --git a/src/commands/info/links.ts b/src/commands/info/links.ts
index 29152d9..b3a762a 100644
--- a/src/commands/info/links.ts
+++ b/src/commands/info/links.ts
@@ -27,7 +27,7 @@ export default class LinksCommand extends BushCommand {
label: 'Invite Me',
url: `https://discord.com/api/oauth2/authorize?client_id=${
client.user!.id
- }&permissions=2147483647&scope=bot%20applications.commands`
+ }&permissions=5368709119918&scope=bot%20applications.commands`
}),
new MessageButton({
style: 'LINK',
diff --git a/src/commands/info/snowflake.ts b/src/commands/info/snowflake.ts
index 8d6129b..df11bce 100644
--- a/src/commands/info/snowflake.ts
+++ b/src/commands/info/snowflake.ts
@@ -139,7 +139,7 @@ export default class SnowflakeCommand extends BushCommand {
const deconstructedSnowflake: DeconstructedSnowflake = SnowflakeUtil.deconstruct(snowflake);
const snowflakeInfo = [
`**Timestamp:** ${deconstructedSnowflake.timestamp}`,
- `**Created:** ${deconstructedSnowflake.date.toLocaleString()}`,
+ `**Created:** ${util.timestamp(deconstructedSnowflake.date)}`,
`**Worker ID:** ${deconstructedSnowflake.workerId}`,
`**Process ID:** ${deconstructedSnowflake.processId}`,
`**Increment:** ${deconstructedSnowflake.increment}`
diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts
index 745dcf0..98ef3ae 100644
--- a/src/commands/info/userInfo.ts
+++ b/src/commands/info/userInfo.ts
@@ -85,11 +85,11 @@ export default class UserInfoCommand extends BushCommand {
else if (member?.permissions.has('ADMINISTRATOR')) emojis.push(client.consts.mappings.otherEmojis.ADMIN);
if (member?.premiumSinceTimestamp) emojis.push(client.consts.mappings.otherEmojis.BOOSTER);
- const createdAt = user.createdAt.toLocaleString(),
+ const createdAt = util.timestamp(user.createdAt),
createdAtDelta = util.dateDelta(user.createdAt),
- joinedAt = member?.joinedAt?.toLocaleString(),
+ joinedAt = util.timestamp(member?.joinedAt),
joinedAtDelta = member && member.joinedAt ? util.dateDelta(member.joinedAt, 2) : undefined,
- premiumSince = member?.premiumSince?.toLocaleString(),
+ premiumSince = util.timestamp(member?.premiumSince),
premiumSinceDelta = member && member.premiumSince ? util.dateDelta(member.premiumSince, 2) : undefined;
// General Info
diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts
index 953a6c5..4fb1765 100644
--- a/src/commands/leveling/leaderboard.ts
+++ b/src/commands/leveling/leaderboard.ts
@@ -41,8 +41,19 @@ export default class LeaderboardCommand extends BushCommand {
if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`);
if (!(await message.guild.hasFeature('leveling')))
return await message.util.reply(
- `${util.emojis.error} This command can only be run in commands with the leveling feature enabled.`
+ `${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${
+ message.member?.permissions.has('MANAGE_GUILD')
+ ? ` You can toggle features using the \`${
+ message.util.isSlash
+ ? '/'
+ : client.config.isDevelopment
+ ? 'dev '
+ : message.util.parsed?.prefix ?? client.config.prefix
+ }features\` command.`
+ : ''
+ }`
);
+
const ranks = (await Level.findAll({ where: { guild: message.guild.id } })).sort((a, b) => b.xp - a.xp);
const mapedRanks = ranks.map(
(val, index) => `\`${index + 1}\` <@${val.user}> - Level ${val.level} (${val.xp.toLocaleString()} xp)`
diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts
index f14c005..33ad705 100644
--- a/src/commands/leveling/level.ts
+++ b/src/commands/leveling/level.ts
@@ -132,7 +132,17 @@ export default class LevelCommand extends BushCommand {
if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`);
if (!(await message.guild.hasFeature('leveling')))
return await message.util.reply(
- `${util.emojis.error} This command can only be run in commands with the leveling feature enabled.`
+ `${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${
+ message.member?.permissions.has('MANAGE_GUILD')
+ ? ` You can toggle features using the \`${
+ message.util.isSlash
+ ? '/'
+ : client.config.isDevelopment
+ ? 'dev '
+ : message.util.parsed?.prefix ?? client.config.prefix
+ }features\` command.`
+ : ''
+ }`
);
const user = args.user ?? message.author;
try {
diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts
index d1a3900..c72ff39 100644
--- a/src/commands/moderation/modlog.ts
+++ b/src/commands/moderation/modlog.ts
@@ -53,7 +53,7 @@ export default class ModlogCommand extends BushCommand {
modLog.push(`**Moderator**: <@!${log.moderator}>`);
if (log.duration) modLog.push(`**Duration**: ${util.humanizeDuration(log.duration)}`);
modLog.push(`**Reason**: ${trim(log.reason ?? 'No Reason Specified.')}`);
- modLog.push(`**Date**: ${log.createdAt.toLocaleString()}`);
+ modLog.push(`**Date**: ${util.timestamp(log.createdAt)}`);
if (log.evidence) modLog.push(`**Evidence:** ${trim(log.evidence)}`);
return modLog.join(`\n`);
}
diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts
index 5025ede..a319ff9 100644
--- a/src/commands/moderation/unban.ts
+++ b/src/commands/moderation/unban.ts
@@ -76,7 +76,7 @@ export default class UnbanCommand extends BushCommand {
case 'error creating modlog entry':
return `${util.emojis.error} While unbanning **${user.tag}**, there was an error creating a modlog entry, please report this to my developers.`;
case 'user not banned':
- return `${util.emojis.warn} **${user.tag}** but I tried to unban them anyways.`;
+ return `${util.emojis.warn} **${user.tag}** is not banned but I tried to unban them anyways.`;
case 'success':
return `${util.emojis.success} Successfully unbanned **${user.tag}**.`;
}