aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/_fake-command/ironmoon.ts4
-rw-r--r--src/commands/admin/channelPermissions.ts80
-rw-r--r--src/commands/admin/roleAll.ts32
-rw-r--r--src/commands/config/blacklist.ts11
-rw-r--r--src/commands/config/config.ts10
-rw-r--r--src/commands/config/customAutomodPhrases.ts4
-rw-r--r--src/commands/config/disable.ts4
-rw-r--r--src/commands/config/features.ts4
-rw-r--r--src/commands/config/levelRoles.ts2
-rw-r--r--src/commands/config/log.ts7
-rw-r--r--src/commands/dev/__template.ts5
-rw-r--r--src/commands/dev/eval.ts8
-rw-r--r--src/commands/dev/reload.ts4
-rw-r--r--src/commands/dev/say.ts6
-rw-r--r--src/commands/dev/servers.ts4
-rw-r--r--src/commands/dev/sh.ts4
-rw-r--r--src/commands/dev/superUser.ts4
-rw-r--r--src/commands/dev/test.ts4
-rw-r--r--src/commands/fun/coinflip.ts7
-rw-r--r--src/commands/fun/dice.ts4
-rw-r--r--src/commands/fun/eightBall.ts4
-rw-r--r--src/commands/fun/minesweeper.ts4
-rw-r--r--src/commands/info/avatar.ts6
-rw-r--r--src/commands/info/botInfo.ts10
-rw-r--r--src/commands/info/color.ts7
-rw-r--r--src/commands/info/guildInfo.ts11
-rw-r--r--src/commands/info/icon.ts6
-rw-r--r--src/commands/info/links.ts4
-rw-r--r--src/commands/info/ping.ts6
-rw-r--r--src/commands/info/pronouns.ts8
-rw-r--r--src/commands/info/snowflake.ts4
-rw-r--r--src/commands/info/userInfo.ts8
-rw-r--r--src/commands/leveling/leaderboard.ts4
-rw-r--r--src/commands/leveling/level.ts4
-rw-r--r--src/commands/leveling/setLevel.ts7
-rw-r--r--src/commands/leveling/setXp.ts7
-rw-r--r--src/commands/moderation/_lockdown.ts4
-rw-r--r--src/commands/moderation/ban.ts10
-rw-r--r--src/commands/moderation/evidence.ts4
-rw-r--r--src/commands/moderation/hideCase.ts9
-rw-r--r--src/commands/moderation/kick.ts4
-rw-r--r--src/commands/moderation/modlog.ts4
-rw-r--r--src/commands/moderation/mute.ts10
-rw-r--r--src/commands/moderation/purge.ts19
-rw-r--r--src/commands/moderation/removeReactionEmoji.ts4
-rw-r--r--src/commands/moderation/role.ts4
-rw-r--r--src/commands/moderation/slowmode.ts4
-rw-r--r--src/commands/moderation/unban.ts7
-rw-r--r--src/commands/moderation/unmute.ts4
-rw-r--r--src/commands/moderation/warn.ts4
-rw-r--r--src/commands/moulberry-bush/capePerms.ts4
-rw-r--r--src/commands/moulberry-bush/capes.ts54
-rw-r--r--src/commands/moulberry-bush/giveawayPing.ts4
-rw-r--r--src/commands/moulberry-bush/moulHammer.ts6
-rw-r--r--src/commands/moulberry-bush/report.ts17
-rw-r--r--src/commands/moulberry-bush/rule.ts6
-rw-r--r--src/commands/moulberry-bush/serverStatus.ts8
-rw-r--r--src/commands/utilities/activity.ts5
-rw-r--r--src/commands/utilities/calculator.ts4
-rw-r--r--src/commands/utilities/decode.ts4
-rw-r--r--src/commands/utilities/hash.ts4
-rw-r--r--src/commands/utilities/price.ts94
-rw-r--r--src/commands/utilities/steal.ts4
-rw-r--r--src/commands/utilities/suicide.ts4
-rw-r--r--src/commands/utilities/uuid.ts13
-rw-r--r--src/commands/utilities/viewRaw.ts8
-rw-r--r--src/commands/utilities/whoHasRole.ts6
-rw-r--r--src/commands/utilities/wolframAlpha.ts13
-rw-r--r--src/context-menu-commands/message/viewRaw.ts2
-rw-r--r--src/lib/common/AutoMod.ts2
-rw-r--r--src/lib/common/ButtonPaginator.ts2
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts6
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts2
-rw-r--r--src/lib/extensions/discord-akairo/BushCommand.ts10
-rw-r--r--src/lib/utils/BushLogger.ts12
-rw-r--r--src/listeners/client/interactionCreate.ts2
-rw-r--r--src/listeners/client/ready.ts2
-rw-r--r--src/listeners/commands/commandBlocked.ts4
-rw-r--r--src/listeners/commands/commandCooldown.ts2
-rw-r--r--src/listeners/commands/commandError.ts4
-rw-r--r--src/listeners/commands/commandMissingPermissions.ts6
-rw-r--r--src/listeners/commands/messageBlocked.ts2
-rw-r--r--src/listeners/commands/slashBlocked.ts2
-rw-r--r--src/listeners/commands/slashCommandError.ts2
-rw-r--r--src/listeners/commands/slashMissingPermissions.ts4
-rw-r--r--src/listeners/commands/slashNotFound.ts2
-rw-r--r--src/listeners/commands/slashStarted.ts2
-rw-r--r--src/listeners/custom/bushBan.ts4
-rw-r--r--src/listeners/custom/bushKick.ts4
-rw-r--r--src/listeners/custom/bushMute.ts4
-rw-r--r--src/listeners/custom/bushPunishRole.ts4
-rw-r--r--src/listeners/custom/bushPunishRoleRemove.ts4
-rw-r--r--src/listeners/custom/bushPurge.ts2
-rw-r--r--src/listeners/custom/bushUnban.ts4
-rw-r--r--src/listeners/custom/bushUnmute.ts4
-rw-r--r--src/listeners/custom/bushUpdateModlog.ts4
-rw-r--r--src/listeners/custom/bushUpdateSettings.ts4
-rw-r--r--src/listeners/custom/bushWarn.ts4
-rw-r--r--src/listeners/guild/guildCreate.ts2
-rw-r--r--src/listeners/guild/guildMemberAdd.ts6
-rw-r--r--src/listeners/guild/guildMemberRemove.ts6
-rw-r--r--src/listeners/guild/syncUnban.ts2
-rw-r--r--src/listeners/message/autoPublisher.ts2
-rw-r--r--src/listeners/message/automodCreate.ts2
-rw-r--r--src/listeners/message/automodUpdate.ts2
-rw-r--r--src/listeners/message/blacklistedFile.ts2
-rw-r--r--src/listeners/message/boosterMessage.ts2
-rw-r--r--src/listeners/message/directMessage.ts2
-rw-r--r--src/listeners/message/level.ts2
-rw-r--r--src/listeners/other/consoleListener.ts2
-rw-r--r--src/listeners/other/exit.ts2
-rw-r--r--src/listeners/other/promiseRejection.ts2
-rw-r--r--src/listeners/other/uncaughtException.ts2
-rw-r--r--src/listeners/other/warning.ts2
-rw-r--r--src/tasks/cpuUsage.ts2
-rw-r--r--src/tasks/removeExpiredPunishements.ts2
-rw-r--r--src/tasks/updateCache.ts8
-rw-r--r--src/tasks/updateStats.ts2
-rw-r--r--src/tasks/updateSuperUsers.ts2
119 files changed, 429 insertions, 396 deletions
diff --git a/src/commands/_fake-command/ironmoon.ts b/src/commands/_fake-command/ironmoon.ts
index d7e737f..612db85 100644
--- a/src/commands/_fake-command/ironmoon.ts
+++ b/src/commands/_fake-command/ironmoon.ts
@@ -4,7 +4,7 @@ export default class IronmoonCommand extends BushCommand {
public constructor() {
super('ironmoon', {
category: 'fake-commands',
- description: { content: '', examples: '', usage: '' },
+ description: { content: '', examples: [''], usage: [''] },
pseudo: true,
clientPermissions: [],
userPermissions: []
@@ -16,7 +16,7 @@ export default class IronmoonCommand extends BushCommand {
else return false;
}
- public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> {
+ public override async exec(message: BushMessage | BushSlashMessage) {
return await message.util.reply('Your message included the word ironmoon.');
}
}
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts
index bae1133..dc35c87 100644
--- a/src/commands/admin/channelPermissions.ts
+++ b/src/commands/admin/channelPermissions.ts
@@ -1,5 +1,5 @@
-import { BushCommand, BushMessage, ButtonPaginator } from '@lib';
-import { GuildMember, MessageEmbed, Role } from 'discord.js';
+import { BushCommand, BushMessage, BushSlashMessage, ButtonPaginator } from '@lib';
+import { GuildMember, MessageEmbed, PermissionString, Role } from 'discord.js';
export default class ChannelPermissionsCommand extends BushCommand {
public constructor() {
@@ -8,9 +8,9 @@ export default class ChannelPermissionsCommand extends BushCommand {
category: 'admin',
typing: true,
description: {
- content: 'Use to mass change the channel ',
- usage: 'ChannelPerms <role_id> <perm> <state>',
- examples: ['ChannelPerms 783794633129197589 read_messages deny']
+ content: 'Use to mass change the channel permissions.',
+ usage: ['channel-perms <role_id> <perm> <state>'],
+ examples: ['channel-perms 783794633129197589 read_messages deny']
},
args: [
{
@@ -18,7 +18,7 @@ export default class ChannelPermissionsCommand extends BushCommand {
customType: util.arg.union('member', 'member'),
prompt: {
start: 'What user/role would you like to change?',
- retry: 'Invalid response. What user/role would you like to change?'
+ retry: '{error} Choose a valid user/role to change.'
}
},
{
@@ -44,39 +44,79 @@ export default class ChannelPermissionsCommand extends BushCommand {
],
clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_CHANNELS']),
userPermissions: ['ADMINISTRATOR'],
- channel: 'guild'
+ channel: 'guild',
+ slash: true,
+ slashOptions: [
+ {
+ name: 'target',
+ description: 'What user/role would you like to change?',
+ type: 'MENTIONABLE',
+ required: true
+ },
+ {
+ name: 'permission',
+ description: 'What permission would you like to change?',
+ type: 'STRING',
+ required: true
+ },
+ {
+ name: 'state',
+ description: 'What should that permission be set to?',
+ type: 'STRING',
+ choices: [
+ {
+ name: 'Enabled',
+ value: 'true'
+ },
+ {
+ name: 'Disabled',
+ value: 'false'
+ },
+ {
+ name: 'Neutral',
+ value: 'neutral'
+ }
+ ],
+ required: true
+ }
+ ]
});
}
public override async exec(
- message: BushMessage,
- {
- target,
- permission,
- state
- }: {
+ message: BushMessage | BushSlashMessage,
+ args: {
target: Role | GuildMember;
- permission: string;
+ permission: PermissionString | string;
state: 'true' | 'false' | 'neutral';
}
- ): Promise<unknown> {
+ ) {
+ if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`);
+ if (!message.member!.permissions.has('ADMINISTRATOR') && !message.member!.user.isOwner())
+ return await message.util.reply(`${util.emojis.error} You must have admin perms to use this command.`);
+ if (message.util.isSlashMessage(message)) await message.interaction.deferReply();
+
+ const permission: PermissionString = message.util.isSlashMessage(message)
+ ? await util.arg.cast('permission', message, args.permission)
+ : args.permission;
+ if (!permission) return await message.util.reply(`${util.emojis.error} Invalid permission.`);
const failedChannels = [];
- for (const channel of message.guild!.channels.cache.values()) {
+ for (const [, channel] of message.guild!.channels.cache) {
try {
if (channel.isThread()) return;
if (channel.permissionsLocked) return;
- const permissionState = state === 'true' ? true : state === 'false' ? false : null;
+ const permissionState = args.state === 'true' ? true : args.state === 'false' ? false : null;
await channel.permissionOverwrites.create(
- target.id,
+ args.target.id,
{ [permission]: permissionState },
{ reason: 'Changing overwrites for mass channel perms command' }
);
} catch (e) {
- client.console.debug(e.stack);
+ void client.console.error('channelPermissio