aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/admin/channelPermissions.ts6
-rw-r--r--src/commands/config/config.ts12
-rw-r--r--src/commands/config/features.ts6
-rw-r--r--src/commands/config/log.ts14
-rw-r--r--src/commands/dev/eval.ts26
-rw-r--r--src/commands/dev/javascript.ts12
-rw-r--r--src/commands/dev/servers.ts7
-rw-r--r--src/commands/dev/sh.ts14
-rw-r--r--src/commands/dev/superUser.ts11
-rw-r--r--src/commands/dev/test.ts8
-rw-r--r--src/commands/info/avatar.ts4
-rw-r--r--src/commands/info/botInfo.ts46
-rw-r--r--src/commands/info/color.ts14
-rw-r--r--src/commands/info/guildInfo.ts22
-rw-r--r--src/commands/info/help.ts22
-rw-r--r--src/commands/info/icon.ts4
-rw-r--r--src/commands/info/ping.ts14
-rw-r--r--src/commands/info/pronouns.ts4
-rw-r--r--src/commands/info/snowflake.ts16
-rw-r--r--src/commands/info/userInfo.ts16
-rw-r--r--src/commands/leveling/leaderboard.ts6
-rw-r--r--src/commands/moderation/evidence.ts9
-rw-r--r--src/commands/moderation/lockdown.ts10
-rw-r--r--src/commands/moderation/modlog.ts4
-rw-r--r--src/commands/moderation/slowmode.ts2
-rw-r--r--src/commands/moderation/unlockdown.ts10
-rw-r--r--src/commands/moulberry-bush/capePermissions.ts4
-rw-r--r--src/commands/moulberry-bush/capes.ts9
-rw-r--r--src/commands/moulberry-bush/moulHammer.ts4
-rw-r--r--src/commands/moulberry-bush/report.ts26
-rw-r--r--src/commands/moulberry-bush/rule.ts10
-rw-r--r--src/commands/moulberry-bush/serverStatus.ts15
-rw-r--r--src/commands/utilities/activity.ts2
-rw-r--r--src/commands/utilities/calculator.ts11
-rw-r--r--src/commands/utilities/decode.ts17
-rw-r--r--src/commands/utilities/price.ts29
-rw-r--r--src/commands/utilities/reminders.ts5
-rw-r--r--src/commands/utilities/suicide.ts20
-rw-r--r--src/commands/utilities/viewRaw.ts19
-rw-r--r--src/commands/utilities/wolframAlpha.ts13
-rw-r--r--src/lib/common/AutoMod.ts12
-rw-r--r--src/lib/common/ButtonPaginator.ts81
-rw-r--r--src/lib/common/DeleteButton.ts12
-rw-r--r--src/lib/common/util/Moderation.ts4
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts1
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts25
-rw-r--r--src/lib/extensions/discord.js/BushButtonInteraction.ts2
-rw-r--r--src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts2
-rw-r--r--src/lib/extensions/discord.js/BushGuild.ts4
-rw-r--r--src/lib/extensions/discord.js/BushSelectMenuInteraction.ts2
-rw-r--r--src/lib/models/Guild.ts32
-rw-r--r--src/lib/utils/BushConstants.ts44
-rw-r--r--src/lib/utils/BushLogger.ts12
-rw-r--r--src/listeners/bush/joinAutoBan.ts2
-rw-r--r--src/listeners/bush/userUpdateAutoBan.ts2
-rw-r--r--src/listeners/commands/commandBlocked.ts4
-rw-r--r--src/listeners/commands/commandError.ts10
-rw-r--r--src/listeners/guild-custom/bushLockdown.ts18
-rw-r--r--src/listeners/guild-custom/bushUnlockdown.ts18
-rw-r--r--src/listeners/guild/guildCreate.ts4
-rw-r--r--src/listeners/guild/guildDelete.ts4
-rw-r--r--src/listeners/guild/guildMemberAdd.ts4
-rw-r--r--src/listeners/guild/guildMemberRemove.ts4
-rw-r--r--src/listeners/member-custom/bushBan.ts16
-rw-r--r--src/listeners/member-custom/bushBlock.ts18
-rw-r--r--src/listeners/member-custom/bushKick.ts14
-rw-r--r--src/listeners/member-custom/bushMute.ts16
-rw-r--r--src/listeners/member-custom/bushPunishRole.ts14
-rw-r--r--src/listeners/member-custom/bushPunishRoleRemove.ts14
-rw-r--r--src/listeners/member-custom/bushPurge.ts20
-rw-r--r--src/listeners/member-custom/bushRemoveTimeout.ts14
-rw-r--r--src/listeners/member-custom/bushTimeout.ts16
-rw-r--r--src/listeners/member-custom/bushUnban.ts14
-rw-r--r--src/listeners/member-custom/bushUnblock.ts16
-rw-r--r--src/listeners/member-custom/bushUnmute.ts14
-rw-r--r--src/listeners/member-custom/bushUpdateModlog.ts16
-rw-r--r--src/listeners/member-custom/bushUpdateSettings.ts14
-rw-r--r--src/listeners/member-custom/bushWarn.ts14
-rw-r--r--src/listeners/message/autoThread.ts6
-rw-r--r--src/listeners/message/blacklistedFile.ts8
-rw-r--r--src/listeners/message/directMessage.ts6
-rw-r--r--src/listeners/other/consoleListener.ts2
-rw-r--r--src/listeners/track-manual-punishments/modlogSyncBan.ts12
-rw-r--r--src/listeners/track-manual-punishments/modlogSyncKick.ts12
-rw-r--r--src/listeners/track-manual-punishments/modlogSyncTimeout.ts12
-rw-r--r--src/listeners/track-manual-punishments/modlogSyncUnban.ts12
86 files changed, 583 insertions, 523 deletions
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts
index f0d2c65..4f511cd 100644
--- a/src/commands/admin/channelPermissions.ts
+++ b/src/commands/admin/channelPermissions.ts
@@ -1,5 +1,5 @@
import { BushCommand, ButtonPaginator, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
-import { ApplicationCommandOptionType, MessageEmbed, Permissions } from 'discord.js';
+import { ApplicationCommandOptionType, Embed, Permissions } from 'discord.js';
export default class ChannelPermissionsCommand extends BushCommand {
public constructor() {
@@ -89,9 +89,9 @@ export default class ChannelPermissionsCommand extends BushCommand {
}
const failure = failedChannels.map((c) => `<#${c.id}>`).join(' ');
if (failure.length > 2000) {
- const paginate: MessageEmbed[] = [];
+ const paginate: Embed[] = [];
for (let i = 0; i < failure.length; i += 4000) {
- paginate.push(new MessageEmbed().setDescription(failure.substring(i, Math.min(failure.length, i + 4000))));
+ paginate.push(new Embed().setDescription(failure.substring(i, Math.min(failure.length, i + 4000))));
}
const normalMessage = `Finished changing perms! Failed channels:`;
return await ButtonPaginator.send(message, paginate, normalMessage);
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts
index 41bdc04..42ff309 100644
--- a/src/commands/config/config.ts
+++ b/src/commands/config/config.ts
@@ -16,9 +16,10 @@ import {
ButtonComponent,
ButtonStyle,
Channel,
+ Embed,
Formatters,
GuildMember,
- MessageEmbed,
+ InteractionUpdateOptions,
Permissions,
Role,
SelectMenuComponent,
@@ -286,9 +287,9 @@ export default class ConfigCommand extends BushCommand {
public async generateMessageOptions(
message: BushMessage | BushSlashMessage,
setting?: undefined | keyof typeof guildSettingsObj
- ): Promise<MessageOptions> {
+ ): Promise<MessageOptions & InteractionUpdateOptions> {
if (!message.guild) throw new Error('message.guild is null');
- const settingsEmbed = new MessageEmbed().setColor(util.colors.default);
+ const settingsEmbed = new Embed().setColor(util.colors.default);
if (!setting) {
settingsEmbed.setTitle(`${message.guild!.name}'s Settings`);
const desc = settingsArr.map((s) => `:wrench: **${guildSettingsObj[s].name}**`).join('\n');
@@ -364,7 +365,10 @@ export default class ConfigCommand extends BushCommand {
message.util.isSlash ? _.snakeCase(setting) : setting
} ${guildSettingsObj[setting].type.includes('-array') ? 'add/remove' : 'set'} <value>" to set this setting.`
});
- settingsEmbed.addField('value', (await generateCurrentValue(guildSettingsObj[setting].type)) || '[No Value Set]');
+ settingsEmbed.addField({
+ name: 'value',
+ value: (await generateCurrentValue(guildSettingsObj[setting].type)) || '[No Value Set]'
+ });
return { embeds: [settingsEmbed], components: [components] };
}
}
diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts
index fdd6c1e..04c0425 100644
--- a/src/commands/config/features.ts
+++ b/src/commands/config/features.ts
@@ -9,7 +9,7 @@ import {
import {
ActionRow,
ComponentType,
- MessageEmbed,
+ Embed,
Permissions,
SelectMenuComponent,
SelectMenuOption,
@@ -35,7 +35,7 @@ export default class FeaturesCommand extends BushCommand {
public override async exec(message: BushMessage | BushSlashMessage) {
if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be used in servers.`);
- const featureEmbed = new MessageEmbed().setTitle(`${message.guild!.name}'s Features`).setColor(util.colors.default);
+ const featureEmbed = new Embed().setTitle(`${message.guild!.name}'s Features`).setColor(util.colors.default);
const enabledFeatures = await message.guild!.getSetting('enabledFeatures');
this.generateDescription(guildFeaturesArr, enabledFeatures, featureEmbed);
@@ -71,7 +71,7 @@ export default class FeaturesCommand extends BushCommand {
});
}
- public generateDescription(allFeatures: GuildFeatures[], currentFeatures: GuildFeatures[], embed: MessageEmbed): void {
+ public generateDescription(allFeatures: GuildFeatures[], currentFeatures: GuildFeatures[], embed: Embed): void {
embed.setDescription(
allFeatures
.map(
diff --git a/src/commands/config/log.ts b/src/commands/config/log.ts
index 5906623..4c9a20b 100644
--- a/src/commands/config/log.ts
+++ b/src/commands/config/log.ts
@@ -1,6 +1,6 @@
import { BushCommand, guildLogsArr, type ArgType, type BushMessage, type BushSlashMessage, type GuildLogType } from '#lib';
-import { type ArgumentOptions, type Flag } from 'discord-akairo';
-import { ApplicationCommandOptionType, Permissions } from 'discord.js';
+import { ArgumentGeneratorReturn } from 'discord-akairo';
+import { ApplicationCommandOptionType, ChannelType, Permissions } from 'discord.js';
export default class LogCommand extends BushCommand {
public constructor() {
@@ -26,7 +26,13 @@ export default class LogCommand extends BushCommand {
type: 'channel',
prompt: 'What channel would you like these logs to be sent in?',
slashType: ApplicationCommandOptionType.Channel,
- channelTypes: ['GuildText', 'GuildNews', 'GuildNewsThread', 'GuildPublicThread', 'GuildPrivateThread'],
+ channelTypes: [
+ ChannelType.GuildText,
+ ChannelType.GuildNews,
+ ChannelType.GuildNewsThread,
+ ChannelType.GuildPublicThread,
+ ChannelType.GuildPrivateThread
+ ],
only: 'slash'
}
],
@@ -36,7 +42,7 @@ export default class LogCommand extends BushCommand {
});
}
- public override *args(): IterableIterator<ArgumentOptions | Flag> {
+ public override *args(): ArgumentGeneratorReturn {
const log_type = yield {
id: 'log_type',
type: guildLogsArr,
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index 92b1117..c8541c6 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -25,13 +25,13 @@ import {
CommandInteraction,
ContextMenuCommandInteraction,
DMChannel,
+ Embed,
Emoji,
Interaction,
InteractionCollector,
Message,
MessageAttachment,
MessageCollector,
- MessageEmbed,
ReactionCollector,
SelectMenuComponent,
Util
@@ -194,7 +194,7 @@ export default class EvalCommand extends BushCommand {
lang: isTypescript ? 'ts' : 'js'
};
- const embed = new MessageEmbed();
+ const embed = new Embed();
const badPhrases = ['delete', 'destroy'];
if (badPhrases.some((p) => code[code.lang]!.includes(p)) && !args.sudo) {
@@ -233,16 +233,22 @@ export default class EvalCommand extends BushCommand {
: undefined;
embed.setTitle(`${emojis.successFull} Successfully Evaluated Expression`).setColor(colors.success);
- if (inputTS) embed.addField('📥 Input (typescript)', inputTS).addField('📥 Input (transpiled javascript)', inputJS);
- else embed.addField('📥 Input', inputJS);
- embed.addField('📤 Output', output);
- if (methods) embed.addField('🔧 Methods', methods);
- if (proto) embed.addField('⚙️ Proto', proto);
+ if (inputTS)
+ embed
+ .addField({ name: '📥 Input (typescript)', value: inputTS })
+ .addField({ name: '📥 Input (transpiled javascript)', value: inputJS });
+ else embed.addField({ name: '📥 Input', value: inputJS });
+ embed.addField({ name: '📤 Output', value: output });
+ if (methods) embed.addField({ name: '🔧 Methods', value: methods });
+ if (proto) embed.addField({ name: '⚙️ Proto', value: proto });
} catch (e) {
embed.setTitle(`${emojis.errorFull} Unable to Evaluate Expression`).setColor(colors.error);
- if (inputTS) embed.addField('📥 Input (typescript)', inputTS).addField('📥 Input (transpiled javascript)', inputJS);
- else embed.addField('📥 Input', inputJS);
- embed.addField('📤 Error', await util.inspectCleanRedactCodeblock(e, 'js'));
+ if (inputTS)
+ embed
+ .addField({ name: '📥 Input (typescript)', value: inputTS })
+ .addField({ name: '📥 Input (transpiled javascript)', value: inputJS });
+ else embed.addField({ name: '📥 Input', value: inputJS });
+ embed.addField({ name: '📤 Error', value: await util.inspectCleanRedactCodeblock(e, 'js') });
}
embed.setTimestamp().setFooter({ text: message.author.tag, iconURL: message.author.displayAvatarURL() ?? undefined });
diff --git a/src/commands/dev/javascript.ts b/src/commands/dev/javascript.ts
index 9d6a20b..3ede3e2 100644
--- a/src/commands/dev/javascript.ts
+++ b/src/commands/dev/javascript.ts
@@ -1,6 +1,6 @@
import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
import assert from 'assert';
-import { ApplicationCommandOptionType, MessageEmbed } from 'discord.js';
+import { ApplicationCommandOptionType, Embed } from 'discord.js';
import { VM } from 'vm2';
assert(VM);
@@ -53,7 +53,7 @@ export default class JavascriptCommand extends BushCommand {
await message.interaction.deferReply({ ephemeral: false });
}
const code = args.code.replace(/[“”]/g, '"').replace(/```*(?:js)?/g, '');
- const embed = new MessageEmbed();
+ const embed = new Embed();
const input = await util.inspectCleanRedactCodeblock(code, 'js');
try {
@@ -67,12 +67,12 @@ export default class JavascriptCommand extends BushCommand {
});
embed.setTitle(`${util.emojis.successFull} Successfully Evaluated Expression`).setColor(util.colors.success);
- embed.addField('📥 Input', input);
- embed.addField('📤 Output', output);
+ embed.addField({ name: '📥 Input', value: input });
+ embed.addField({ name: '📤 Output', value: output });
} catch (e) {
embed.setTitle(`${util.emojis.errorFull} Unable to Evaluate Expression`).setColor(util.colors.error);
- embed.addField('📥 Input', input);
- embed.addField('📤 Error', await util.inspectCleanRedactCodeblock(e, 'js'));
+ embed.addField({ name: '📥 Input', value: input });
+ embed.addField({ name: '📤 Error', value: await util.inspectCleanRedactCodeblock(e, 'js') });
}
embed.setTimestamp().setFooter({ text: message.author.tag, iconURL: message.author.displayAvatarURL() ?? undefined });
diff --git a/src/commands/dev/servers.ts b/src/commands/dev/servers.ts
index 308d1db..173970b 100644
--- a/src/commands/dev/servers.ts
+++ b/src/commands/dev/servers.ts
@@ -1,5 +1,6 @@
import { BushCommand, ButtonPaginator, type BushMessage, type BushSlashMessage } from '#lib';
-import { type Guild, type MessageEmbedOptions } from 'discord.js';
+import { APIEmbed } from 'discord-api-types';
+import { type Guild } from 'discord.js';
export default class ServersCommand extends BushCommand {
public constructor() {
@@ -18,7 +19,7 @@ export default class ServersCommand extends BushCommand {
public override async exec(message: BushMessage | BushSlashMessage) {
const guilds = [...client.guilds.cache.sort((a, b) => (a.memberCount < b.memberCount ? 1 : -1)).values()];
const chunkedGuilds: Guild[][] = util.chunk(guilds, 10);
- const embeds: MessageEmbedOptions[] = chunkedGuilds.map((chunk) => {
+ const embeds: APIEmbed[] = chunkedGuilds.m