aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/admin/channelPermissions.ts4
-rw-r--r--src/commands/config/customAutomodPhrases.ts64
-rw-r--r--src/commands/config/levelRoles.ts61
-rw-r--r--src/commands/leveling/setLevel.ts2
-rw-r--r--src/commands/moderation/_lockdown.ts2
-rw-r--r--src/commands/moderation/hideCase.ts5
-rw-r--r--src/commands/moderation/mute.ts8
-rw-r--r--src/commands/moderation/role.ts2
-rw-r--r--src/commands/utilities/activity.ts12
-rw-r--r--src/commands/utilities/suicide.ts3
10 files changed, 148 insertions, 15 deletions
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts
index 3b8c157..993e811 100644
--- a/src/commands/admin/channelPermissions.ts
+++ b/src/commands/admin/channelPermissions.ts
@@ -81,8 +81,8 @@ export default class ChannelPermissionsCommand extends BushCommand {
const failure = failedChannels.map((e) => `<#${e.id}>`).join(' ');
if (failure.length > 2000) {
const paginate: MessageEmbed[] = [];
- for (let i = 0; i < failure.length; i += 2000) {
- paginate.push(new MessageEmbed().setDescription(failure.substring(i, Math.min(failure.length, i + 2000))));
+ for (let i = 0; i < failure.length; i += 4000) {
+ paginate.push(new MessageEmbed().setDescription(failure.substring(i, Math.min(failure.length, i + 4000))));
}
const normalMessage = `Finished changing perms! Failed channels:`;
return await client.util.buttonPaginate(message, paginate, normalMessage);
diff --git a/src/commands/config/customAutomodPhrases.ts b/src/commands/config/customAutomodPhrases.ts
new file mode 100644
index 0000000..7735939
--- /dev/null
+++ b/src/commands/config/customAutomodPhrases.ts
@@ -0,0 +1,64 @@
+// import { BushCommand, BushMessage, BushSlashMessage } from '@lib';
+
+// export default class CustomAutomodPhrasesCommand extends BushCommand {
+// public constructor() {
+// super('customAutomodPhrases', {
+// aliases: ['customautomodphrases'],
+// category: 'config',
+// description: {
+// content: 'Configure additional phrases to be used for automod.',
+// usage: 'customautomodphrases <requiredArg> [optionalArg]',
+// examples: ['template 1 2']
+// },
+// args: [
+// {
+// id: 'required_argument',
+// type: 'string',
+// prompt: {
+// start: 'What would you like to set your first argument to be?',
+// retry: '{error} Pick a valid argument.',
+// optional: false
+// }
+// },
+// {
+// id: 'optional_argument',
+// type: 'string',
+// prompt: {
+// start: 'What would you like to set your second argument to be?',
+// retry: '{error} Pick a valid argument.',
+// optional: true
+// }
+// }
+// ],
+// slash: false, //set this to true
+// slashOptions: [
+// {
+// name: 'required_argument',
+// description: 'What would you like to set your first argument to be?',
+// type: 'STRING',
+// required: true
+// },
+// {
+// name: 'optional_argument',
+// description: 'What would you like to set your second argument to be?',
+// type: 'STRING',
+// required: false
+// }
+// ],
+// superUserOnly: true,
+// ownerOnly: true,
+// channel: 'guild',
+// hidden: true,
+// clientPermissions: ['SEND_MESSAGES'],
+// userPermissions: ['SEND_MESSAGES']
+// });
+// }
+
+// public override async exec(
+// message: BushMessage | BushSlashMessage,
+// args: { required_argument: string; optional_argument: string }
+// ): Promise<unknown> {
+// return await message.util.reply(`${util.emojis.error} Do not use the template command.`);
+// args;
+// }
+// }
diff --git a/src/commands/config/levelRoles.ts b/src/commands/config/levelRoles.ts
new file mode 100644
index 0000000..df63914
--- /dev/null
+++ b/src/commands/config/levelRoles.ts
@@ -0,0 +1,61 @@
+import { BushCommand, BushMessage, BushSlashMessage } from '@lib';
+
+export default class LevelRolesCommand extends BushCommand {
+ public constructor() {
+ super('levelRole', {
+ aliases: ['levelrole', 'levelroles', 'lr'],
+ category: 'config',
+ description: {
+ content: 'Command description.',
+ usage: 'levelrole <role> <level>',
+ examples: ['levelrole 1 2']
+ },
+ args: [
+ {
+ id: 'role',
+ type: 'role',
+ prompt: {
+ start: 'What would you like to set your first argument to be?',
+ retry: '{error} Pick a valid argument.',
+ optional: false
+ }
+ },
+ {
+ id: 'level',
+ type: 'integer',
+ prompt: {
+ start: 'What would you like to set your second argument to be?',
+ retry: '{error} Pick a valid argument.',
+ optional: false
+ }
+ }
+ ],
+ slash: true,
+ slashOptions: [
+ {
+ name: 'role',
+ description: 'What would you like to set your first argument to be?',
+ type: 'STRING',
+ required: true
+ },
+ {
+ name: 'level',
+ description: 'What would you like to set your second argument to be?',
+ type: 'STRING',
+ required: true
+ }
+ ],
+ channel: 'guild',
+ clientPermissions: ['SEND_MESSAGES'],
+ userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD', 'MANAGE_ROLES']
+ });
+ }
+
+ public override async exec(
+ message: BushMessage | BushSlashMessage,
+ args: { required_argument: string; optional_argument: string }
+ ): Promise<unknown> {
+ return await message.util.reply(`${util.emojis.error} Do not use the template command.`);
+ args;
+ }
+}
diff --git a/src/commands/leveling/setLevel.ts b/src/commands/leveling/setLevel.ts
index 2cd9099..1869773 100644
--- a/src/commands/leveling/setLevel.ts
+++ b/src/commands/leveling/setLevel.ts
@@ -22,7 +22,7 @@ export default class SetLevelCommand extends BushCommand {
},
{
id: 'level',
- type: 'number',
+ type: 'integer',
prompt: {
start: 'What level would you like to set the user to?',
retry: '{error} Choose a valid level to set the user to.'
diff --git a/src/commands/moderation/_lockdown.ts b/src/commands/moderation/_lockdown.ts
index 68197df..5df9f18 100644
--- a/src/commands/moderation/_lockdown.ts
+++ b/src/commands/moderation/_lockdown.ts
@@ -34,7 +34,7 @@ export default class LockdownCommand extends BushCommand {
}
public override async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise<unknown> {
- return await message.util.reply('no');
+ return await message.util.reply('Unfortunately my developer is too lazy to implement this command.');
if (!all) {
if (!['GUILD_TEXT', 'GUILD_NEWS'].includes(message.channel!.type))
return message.util.reply(`${util.emojis.error} You can only lock down text and announcement channels.`);
diff --git a/src/commands/moderation/hideCase.ts b/src/commands/moderation/hideCase.ts
index 2529531..cf7b4de 100644
--- a/src/commands/moderation/hideCase.ts
+++ b/src/commands/moderation/hideCase.ts
@@ -20,7 +20,10 @@ export default class HideCaseCommand extends BushCommand {
}
}
],
- userPermissions: ['MANAGE_MESSAGES'],
+ userPermissions: (message) => {
+ return message.member?.permissions.has('MANAGE_MESSAGES') ? null : ['MANAGE_MESSAGES'];
+ },
+ clientPermissions: ['SEND_MESSAGES'],
slash: true,
slashOptions: [
{
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts
index de79b32..9e68d63 100644
--- a/src/commands/moderation/mute.ts
+++ b/src/commands/moderation/mute.ts
@@ -99,13 +99,13 @@ export default class MuteCommand extends BushCommand {
const prefix = await message.guild!.getSetting('prefix');
switch (responseCode) {
case 'missing permissions':
- return `${util.emojis.error} Could not mute ${victimBoldTag} because I am missing the \`Manage Roles\` permission.`;
+ return `${util.emojis.error} Could not mute ${victimBoldTag} because I am missing the **Manage Roles** permission.`;
case 'no mute role':
- return `${util.emojis.error} Could not mute ${victimBoldTag}, you must set a mute role with \`${prefix}muterole\`.`;
+ return `${util.emojis.error} Could not mute ${victimBoldTag}, you must set a mute role with \`${prefix}config muteRole\`.`;
case 'invalid mute role':
- return `${util.emojis.error} Could not mute ${victimBoldTag} because the current mute role no longer exists. Please set a new mute role with \`${prefix}muterole\`.`;
+ return `${util.emojis.error} Could not mute ${victimBoldTag} because the current mute role no longer exists. Please set a new mute role with \`${prefix}config muteRole\`.`;
case 'mute role not manageable':
- return `${util.emojis.error} Could not mute ${victimBoldTag} because I cannot assign the current mute role, either change the role's position or set a new mute role with \`${prefix}muterole\`.`;
+ return `${util.emojis.error} Could not mute ${victimBoldTag} because I cannot assign the current mute role, either change the role's position or set a new mute role with \`${prefix}config muteRole\`.`;
case 'error giving mute role':
return `${util.emojis.error} Could not mute ${victimBoldTag}, there was an error assigning them the mute role.`;
case 'error creating modlog entry':
diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts
index fd7b817..8cdfea0 100644
--- a/src/commands/moderation/role.ts
+++ b/src/commands/moderation/role.ts
@@ -9,7 +9,7 @@ export default class RoleCommand extends BushCommand {
description: {
content: "Manages users' roles.",
usage: 'role <add|remove> <user> <role> [duration]',
- examples: ['role add spammer nogiveaways 7days']
+ examples: ['role add spammer nogiveaways 7days', 'ra tyman muted', 'rr tyman staff']
},
slash: true,
slashOptions: [
diff --git a/src/commands/utilities/activity.ts b/src/commands/utilities/activity.ts
index 2d818e7..30f11cb 100644
--- a/src/commands/utilities/activity.ts
+++ b/src/commands/utilities/activity.ts
@@ -6,16 +6,19 @@ const activityMap = {
'Betrayal.io': '773336526917861400',
'Fishington.io': '814288819477020702',
'YouTube Together': '755600276941176913',
- 'Chess in the Park': '832012774040141894'
+ 'Chess in the Park': '832012774040141894',
+ 'Watch Together': '880218394199220334'
};
function map(phase: string) {
- if (['yt', 'youtube'].includes(phase)) return activityMap['YouTube Together'];
+ if (client.consts.regex.snowflake.test(phase)) return phase;
+ else if (Object.keys(activityMap).includes(phase)) return activityMap[phase as keyof typeof activityMap];
+ else if (['yt', 'youtube'].includes(phase)) return activityMap['Watch Together'];
else if (['chess', 'park'].includes(phase)) return activityMap['Chess in the Park'];
else if (['poker'].includes(phase)) return activityMap['Poker Night'];
else if (['fish', 'fishing', 'fishington'].includes(phase)) return activityMap['Fishington.io'];
else if (['betrayal'].includes(phase)) return activityMap['Betrayal.io'];
- else return undefined;
+ else return null;
}
const activityTypeCaster = (_message: Message | BushMessage | BushSlashMessage, phrase: string) => {
@@ -76,7 +79,8 @@ export default class YouTubeCommand extends BushCommand {
{ name: 'Betrayal.io', value: '773336526917861400' },
{ name: 'Fishington.io', value: '814288819477020702' },
{ name: 'YouTube Together', value: '755600276941176913' },
- { name: 'Chess in the Park', value: '832012774040141894' }
+ { name: 'Chess in the Park', value: '832012774040141894' },
+ { name: 'Watch Together', value: '880218394199220334' }
]
}
],
diff --git a/src/commands/utilities/suicide.ts b/src/commands/utilities/suicide.ts
index 0ec84a5..a05cdaa 100644
--- a/src/commands/utilities/suicide.ts
+++ b/src/commands/utilities/suicide.ts
@@ -13,7 +13,8 @@ export default class TemplateCommand extends BushCommand {
},
slash: true,
clientPermissions: ['SEND_MESSAGES'],
- userPermissions: ['SEND_MESSAGES']
+ userPermissions: ['SEND_MESSAGES'],
+ bypassChannelBlacklist: true
});
}