aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-28 09:27:41 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-28 09:27:41 -0500
commit453683b57b8ff013ff25e2aaa4aa1d2e047edcb7 (patch)
tree8b98d2f30dbb6a8448602446cfacf9091667cc33 /src
parentde4c3dcaf172804d34ae708be1ed3e75af42f4d5 (diff)
downloadtanzanite-453683b57b8ff013ff25e2aaa4aa1d2e047edcb7.tar.gz
tanzanite-453683b57b8ff013ff25e2aaa4aa1d2e047edcb7.tar.bz2
tanzanite-453683b57b8ff013ff25e2aaa4aa1d2e047edcb7.zip
a few small changes
Diffstat (limited to 'src')
-rw-r--r--src/arguments/messageLink.ts19
-rw-r--r--src/commands/_fake-command/ironmoon.ts4
-rw-r--r--src/commands/admin/channelPermissions.ts77
-rw-r--r--src/commands/admin/roleAll.ts38
-rw-r--r--src/commands/config/blacklist.ts62
-rw-r--r--src/commands/config/config.ts14
-rw-r--r--src/commands/config/customAutomodPhrases.ts8
-rw-r--r--src/commands/config/disable.ts134
-rw-r--r--src/commands/config/features.ts8
-rw-r--r--src/commands/config/levelRoles.ts24
-rw-r--r--src/commands/config/log.ts33
-rw-r--r--src/commands/dev/__template.ts41
-rw-r--r--src/commands/dev/dm.ts46
-rw-r--r--src/commands/dev/eval.ts103
-rw-r--r--src/commands/dev/javascript.ts30
-rw-r--r--src/commands/dev/reload.ts22
-rw-r--r--src/commands/dev/say.ts14
-rw-r--r--src/commands/dev/servers.ts10
-rw-r--r--src/commands/dev/sh.ts16
-rw-r--r--src/commands/dev/superUser.ts25
-rw-r--r--src/commands/dev/test.ts19
-rw-r--r--src/commands/fun/coinflip.ts8
-rw-r--r--src/commands/fun/dice.ts8
-rw-r--r--src/commands/fun/eightBall.ts24
-rw-r--r--src/commands/fun/minesweeper.ts74
-rw-r--r--src/commands/info/avatar.ts29
-rw-r--r--src/commands/info/botInfo.ts8
-rw-r--r--src/commands/info/color.ts38
-rw-r--r--src/commands/info/guildInfo.ts63
-rw-r--r--src/commands/info/help.ts49
-rw-r--r--src/commands/info/icon.ts8
-rw-r--r--src/commands/info/links.ts8
-rw-r--r--src/commands/info/ping.ts8
-rw-r--r--src/commands/info/pronouns.ts26
-rw-r--r--src/commands/info/snowflake.ts54
-rw-r--r--src/commands/info/userInfo.ts29
-rw-r--r--src/commands/leveling/leaderboard.ts26
-rw-r--r--src/commands/leveling/level.ts26
-rw-r--r--src/commands/leveling/setLevel.ts38
-rw-r--r--src/commands/leveling/setXp.ts40
-rw-r--r--src/commands/moderation/_lockdown.ts23
-rw-r--r--src/commands/moderation/activePunishments.ts76
-rw-r--r--src/commands/moderation/ban.ts73
-rw-r--r--src/commands/moderation/evidence.ts32
-rw-r--r--src/commands/moderation/hideCase.ts24
-rw-r--r--src/commands/moderation/kick.ts49
-rw-r--r--src/commands/moderation/modlog.ts46
-rw-r--r--src/commands/moderation/mute.ts49
-rw-r--r--src/commands/moderation/purge.ts57
-rw-r--r--src/commands/moderation/removeReactionEmoji.ts48
-rw-r--r--src/commands/moderation/role.ts123
-rw-r--r--src/commands/moderation/slowmode.ts44
-rw-r--r--src/commands/moderation/unban.ts42
-rw-r--r--src/commands/moderation/unmute.ts49
-rw-r--r--src/commands/moderation/warn.ts49
-rw-r--r--src/commands/moulberry-bush/capePerms.ts27
-rw-r--r--src/commands/moulberry-bush/capes.ts28
-rw-r--r--src/commands/moulberry-bush/giveawayPing.ts8
-rw-r--r--src/commands/moulberry-bush/moulHammer.ts22
-rw-r--r--src/commands/moulberry-bush/report.ts41
-rw-r--r--src/commands/moulberry-bush/rule.ts45
-rw-r--r--src/commands/moulberry-bush/serverStatus.ts8
-rw-r--r--src/commands/utilities/activity.ts127
-rw-r--r--src/commands/utilities/calculator.ts25
-rw-r--r--src/commands/utilities/decode.ts56
-rw-r--r--src/commands/utilities/hash.ts16
-rw-r--r--src/commands/utilities/price.ts35
-rw-r--r--src/commands/utilities/steal.ts105
-rw-r--r--src/commands/utilities/suicide.ts8
-rw-r--r--src/commands/utilities/uuid.ts39
-rw-r--r--src/commands/utilities/viewRaw.ts78
-rw-r--r--src/commands/utilities/whoHasRole.ts26
-rw-r--r--src/commands/utilities/wolframAlpha.ts37
-rw-r--r--src/lib/common/Format.ts52
-rw-r--r--src/lib/common/util/Arg.ts6
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts4
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts283
-rw-r--r--src/lib/extensions/discord-akairo/BushCommand.ts309
-rw-r--r--src/lib/extensions/discord.js/BushGuild.ts48
-rw-r--r--src/lib/extensions/global.d.ts9
-rw-r--r--src/lib/utils/BushConstants.ts399
-rw-r--r--src/lib/utils/BushLogger.ts68
-rw-r--r--src/listeners/client/ready.ts5
-rw-r--r--src/listeners/commands/commandBlocked.ts12
-rw-r--r--src/listeners/commands/messageBlocked.ts5
-rw-r--r--src/listeners/custom/bushLevelUpdate.ts8
-rw-r--r--src/listeners/guild/guildMemberAdd.ts51
-rw-r--r--src/listeners/guild/guildMemberRemove.ts14
-rw-r--r--src/listeners/other/promiseRejection.ts3
-rw-r--r--src/listeners/other/uncaughtException.ts3
90 files changed, 2150 insertions, 1955 deletions
diff --git a/src/arguments/messageLink.ts b/src/arguments/messageLink.ts
new file mode 100644
index 0000000..d270abd
--- /dev/null
+++ b/src/arguments/messageLink.ts
@@ -0,0 +1,19 @@
+import { type BushArgumentTypeCaster } from '../lib';
+
+export const messageLink: BushArgumentTypeCaster = async (_, phrase) => {
+ const match = client.consts.regex.messageLink.exec(phrase);
+ if (!match || !match.groups) return null;
+
+ const { guild_id, channel_id, message_id } = match.groups;
+
+ if (!guild_id || !channel_id || message_id) return null;
+
+ const guild = client.guilds.cache.get(guild_id);
+ if (!guild) return null;
+
+ const channel = guild.channels.cache.get(channel_id);
+ if (!channel || (!channel.isText() && !channel.isThread())) return null;
+
+ const message = await channel.messages.fetch(message_id).catch(() => null);
+ return message;
+};
diff --git a/src/commands/_fake-command/ironmoon.ts b/src/commands/_fake-command/ironmoon.ts
index b13d1d3..428b554 100644
--- a/src/commands/_fake-command/ironmoon.ts
+++ b/src/commands/_fake-command/ironmoon.ts
@@ -4,7 +4,9 @@ export default class IronmoonCommand extends BushCommand {
public constructor() {
super('ironmoon', {
category: 'fake-commands',
- description: { content: '', examples: [''], usage: [''] },
+ description: '',
+ examples: [''],
+ usage: [''],
pseudo: true,
clientPermissions: [],
userPermissions: []
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts
index befa3ea..b44ae21 100644
--- a/src/commands/admin/channelPermissions.ts
+++ b/src/commands/admin/channelPermissions.ts
@@ -7,79 +7,50 @@ export default class ChannelPermissionsCommand extends BushCommand {
aliases: ['channel-perms', 'cperms', 'cperm', 'chanperms', 'chanperm', 'channel-permissions'],
category: 'admin',
typing: true,
- description: {
- content: 'Use to mass change the channel permissions.',
- usage: ['channel-perms <role_id> <perm> <state>'],
- examples: ['channel-perms 783794633129197589 read_messages deny']
- },
+ description: 'Use to mass change the channel permissions.',
+ usage: ['channel-perms <role_id> <perm> <state>'],
+ examples: ['channel-perms 783794633129197589 read_messages deny'],
args: [
{
id: 'target',
- customType: util.arg.union('member', 'member'),
- prompt: {
- start: 'What user/role would you like to change?',
- retry: '{error} Choose a valid user/role to change.'
- }
+ description: 'The user/role to change the permissions of.',
+ customType: util.arg.union('member', 'role'),
+ readableType: 'member|role',
+ prompt: 'What user/role would you like to change?',
+ retry: '{error} Choose a valid user/role to change.',
+ slashType: 'MENTIONABLE'
},
{
id: 'permission',
+ description: 'The permission to change for the target user/role.',
type: 'permission',
- prompt: {
- start: 'What permission would you like to change?',
- retry: '{error} Choose a valid permission.'
- }
+ prompt: 'What permission would you like to change?',
+ retry: '{error} Choose a valid permission.',
+ slashType: 'STRING'
},
{
id: 'state',
+ description: 'The state that the permission should be set to for the target.',
customType: [
['true', '1', 'yes', 'enable', 'allow'],
['false', '0', 'no', 'disable', 'disallow', 'deny'],
['neutral', 'remove', 'none']
],
- prompt: {
- start: 'What should that permission be set to?',
- retry: '{error} Set the state to either `enable`, `disable`, or `remove`.'
- }
+ readableType: "'enable'|'disable'|'remove'",
+ prompt: 'What should that permission be set to?',
+ retry: '{error} Set the state to either `enable`, `disable`, or `remove`.',
+ slashType: 'STRING',
+ choices: [
+ { name: 'Enabled', value: 'true' },
+ { name: 'Disabled', value: 'false' },
+ { name: 'Neutral', value: 'neutral' }
+ ]
}
],
clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_CHANNELS']),
userPermissions: ['ADMINISTRATOR'],
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
- }
- ]
+ slash: true
});
}
diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts
index 3c6b629..585e6cc 100644
--- a/src/commands/admin/roleAll.ts
+++ b/src/commands/admin/roleAll.ts
@@ -6,46 +6,34 @@ export default class RoleAllCommand extends BushCommand {
super('roleAll', {
aliases: ['role-all', 'rall'],
category: 'admin',
- description: {
- content: 'Give a role to every member on the server.',
- usage: ['role-all <role> [--bots]'],
- examples: ['role-all 783794633129197589 --bots']
- },
+ description: 'Give a role to every member on the server.',
+ usage: ['role-all <role> [--bots]'],
+ examples: ['role-all 783794633129197589 --bots'],
args: [
{
id: 'role',
+ description: 'The role to assigned to every member on the server.',
type: 'role',
- prompt: {
- start: 'What role would you like to give to every member on the server?',
- retry: '{error} Pick a valid role.'
- }
+ prompt: 'What role would you like to give to every member on the server?',
+ retry: '{error} Pick a valid role.',
+ slashType: 'ROLE'
},
{
id: 'bots',
+ description: 'Also give the role to bots.',
match: 'flag',
+ prompt: 'Would you like to also give roles to bots?',
flag: '--bots',
- default: false
+ default: false,
+ slashType: 'BOOLEAN',
+ optional: true
}
],
channel: 'guild',
clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_ROLES']),
userPermissions: ['ADMINISTRATOR'],
typing: true,
- slash: true,
- slashOptions: [
- {
- name: 'role',
- description: 'What role would you like to give to every member on the server?',
- type: 'ROLE',
- required: true
- },
- {
- name: 'bots',
- description: 'Would you like to also give roles to bots?',
- type: 'BOOLEAN',
- required: false
- }
- ]
+ slash: true
});
}
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts
index f0173a4..8bb778c 100644
--- a/src/commands/config/blacklist.ts
+++ b/src/commands/config/blacklist.ts
@@ -6,45 +6,43 @@ export default class BlacklistCommand extends BushCommand {
super('blacklist', {
aliases: ['blacklist', 'unblacklist'],
category: 'config',
- description: {
- content: 'A command to blacklist users and channels.',
- usage: ['blacklist|unblacklist <user|channel>'],
- examples: ['blacklist @user', 'unblacklist #channel']
- },
+ description: 'A command to blacklist users and channels.',
+ usage: ['blacklist|unblacklist <user|channel>'],
+ examples: ['blacklist @user', 'unblacklist #channel'],
args: [
{
+ id: 'action',
+ description: 'Whether to blacklist or unblacklist the target.',
+ readableType: "'blacklist'|'unblacklist'",
+ prompt: 'Would you like to add or remove someone or something from/to the blacklist?',
+ slashType: 'STRING',
+ choices: [
+ { name: 'blacklist', value: 'blacklist' },
+ { name: 'unblacklist', value: 'unblacklist' }
+ ],
+ only: 'slash'
+ },
+ {
id: 'target',
+ description: 'The channel/user to blacklist.',
customType: util.arg.union('channel', 'user'),
- prompt: {
- start: 'What channel or user that you would like to blacklist/unblacklist?',
- retry: '{error} Pick a valid user or channel.'
- }
+ readableType: 'channel|user',
+ prompt: 'What channel or user that you would like to blacklist/unblacklist?',
+ retry: '{error} Pick a valid user or channel.',
+ slashType: 'STRING'
},
{
id: 'global',
+ description: 'Blacklist the target globally.',
match: 'flag',
- flag: '--global'
+ flag: '--global',
+ optional: true,
+ slashType: false,
+ only: 'text',
+ ownerOnly: true
}
],
slash: true,
- slashOptions: [
- {
- name: 'action',
- description: 'Would you like to add or remove someone or something from/to the blacklist?',
- type: 'STRING',
- choices: [
- { name: 'blacklist', value: 'blacklist' },
- { name: 'unblacklist', value: 'unblacklist' }
- ],
- required: true
- },
- {
- name: 'target',
- description: 'What channel or user that you would like to blacklist/unblacklist?',
- type: 'STRING',
- required: true
- }
- ],
channel: 'guild',
clientPermissions: (m) => util.clientSendAndPermCheck(m),
userPermissions: ['MANAGE_GUILD']
@@ -82,14 +80,14 @@ export default class BlacklistCommand extends BushCommand {
.catch(() => false);
if (!success)
return await message.util.reply({
- content: `${util.emojis.error} There was an error globally ${action}ing ${util.format.bold(
+ content: `${util.emojis.error} There was an error globally ${action}ing ${util.format.input(
target?.tag ?? target.name
)}.`,
allowedMentions: AllowedMentions.none()
});
else
return await message.util.reply({
- content: `${util.emojis.success} Successfully ${action}ed ${util.format.bold(target?.tag ?? target.name)} globally.`,
+ content: `${util.emojis.success} Successfully ${action}ed ${util.format.input(target?.tag ?? target.name)} globally.`,
allowedMentions: AllowedMentions.none()
});
// guild disable
@@ -110,12 +108,12 @@ export default class BlacklistCommand extends BushCommand {
.catch(() => false);
if (!success)
return await message.util.reply({
- content: `${util.emojis.error} There was an error ${action}ing ${util.format.bold(target?.tag ?? target.name)}.`,
+ content: `${util.emojis.error} There was an error ${action}ing ${util.format.input(target?.tag ?? target.name)}.`,
allowedMentions: AllowedMentions.none()
});
else
return await message.util.reply({
- content: `${util.emojis.success} Successfully ${action}ed ${util.format.bold(target?.tag ?? target.name)}.`,
+ content: `${util.emojis.success} Successfully ${action}ed ${util.format.input(target?.tag ?? target.name)}.`,
allowedMentions: AllowedMentions.none()
});
}
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts
index 2ce4246..6af5895 100644
--- a/src/commands/config/config.ts
+++ b/src/commands/config/config.ts
@@ -22,15 +22,11 @@ export default class SettingsCommand extends BushCommand {
super('config', {
aliases: ['config', 'settings', 'setting', 'configure'],