1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-09-29 16:30:59 -04:00

Improved the descriptions that was bothering me...

This commit is contained in:
Toast 2023-03-29 22:21:46 +11:00
parent f51854e258
commit 882e30186f
5 changed files with 19 additions and 19 deletions

View File

@ -30,19 +30,19 @@ export default {
.setDescription('description placeholder') .setDescription('description placeholder')
.addSubcommand((opt)=>opt .addSubcommand((opt)=>opt
.setName('view') .setName('view')
.setDescription('View the list of currently banned words.')) .setDescription('View the list of currently banned words'))
.addSubcommand((opt)=>opt .addSubcommand((opt)=>opt
.setName('add') .setName('add')
.setDescription('What word do you want to add?') .setDescription('Add the word to the list')
.addStringOption((optt)=>optt .addStringOption((optt)=>optt
.setName('word') .setName('word')
.setDescription('Add the specific word to automod\'s bannedWords database.') .setDescription('Add the specific word to automod\'s bannedWords database')
.setRequired(true))) .setRequired(true)))
.addSubcommand((opt)=>opt .addSubcommand((opt)=>opt
.setName('remove') .setName('remove')
.setDescription('What word do you want to remove?') .setDescription('Remove the word from the list')
.addStringOption((optt)=>optt .addStringOption((optt)=>optt
.setName('word') .setName('word')
.setDescription('Remove the specific word from automod\'s bannedWords list.') .setDescription('Remove the specific word from automod\'s bannedWords list')
.setRequired(true))) .setRequired(true)))
} }

View File

@ -13,7 +13,7 @@ export default {
}, },
view: async()=>{ view: async()=>{
const punishment = await client.punishments._content.findById(caseId); const punishment = await client.punishments._content.findById(caseId);
if (!punishment) return interaction.reply('Invalid Case #'); if (!punishment) return interaction.reply('Invalid Case ID');
const cancelledBy = punishment.expired ? await client.punishments._content.findOne({cancels:punishment.id}) : null; const cancelledBy = punishment.expired ? await client.punishments._content.findOne({cancels:punishment.id}) : null;
const cancels = punishment.cancels ? await client.punishments._content.findOne({_id:punishment.cancels}) : null; const cancels = punishment.cancels ? await client.punishments._content.findOne({_id:punishment.cancels}) : null;
const embed = new client.embed().setColor(client.config.embedColor).setTimestamp(punishment.time).setTitle(`${punishment.type[0].toUpperCase()+punishment.type.slice(1)} | Case #${punishment.id}`).addFields( const embed = new client.embed().setColor(client.config.embedColor).setTimestamp(punishment.time).setTitle(`${punishment.type[0].toUpperCase()+punishment.type.slice(1)} | Case #${punishment.id}`).addFields(
@ -22,8 +22,8 @@ export default {
{name: '\u200b', value: '\u200b', inline: true}, {name: '\u200b', value: '\u200b', inline: true},
{name: '🔹 Reason', value: `\`${punishment.reason || 'Reason unspecified'}\``, inline: true}) {name: '🔹 Reason', value: `\`${punishment.reason || 'Reason unspecified'}\``, inline: true})
if (punishment.duration) embed.addFields({name: '🔹 Duration', value: client.formatTime(punishment.duration, 100)}) if (punishment.duration) embed.addFields({name: '🔹 Duration', value: client.formatTime(punishment.duration, 100)})
if (punishment.expired) embed.addFields({name: '🔹 Expired', value: `This case has been overwritten by case #${cancelledBy.id} for reason \`${cancelledBy.reason}\``}) if (punishment.expired) embed.addFields({name: '🔹 Expired', value: `This case has been overwritten by Case #${cancelledBy.id} for reason \`${cancelledBy.reason}\``})
if (punishment.cancels) embed.addFields({name: '🔹 Overwrites', value: `This case overwrites case #${cancels.id} with reason \`${cancels.reason}\``}) if (punishment.cancels) embed.addFields({name: '🔹 Overwrites', value: `This case overwrites Case #${cancels.id} with reason \`${cancels.reason}\``})
interaction.reply({embeds: [embed]}); interaction.reply({embeds: [embed]});
}, },
member: async()=>{ member: async()=>{
@ -40,7 +40,7 @@ export default {
} }
}); });
// if caseid is not a punishment nor a user, failed // if caseid is not a punishment nor a user, failed
if (!userPunishment || userPunishment.length == 0) return interaction.reply('No punishments found for that case # or User ID'); if (!userPunishment || userPunishment.length == 0) return interaction.reply('No punishments found for that Case or User ID');
const pageNum = interaction.options.getInteger('page') ?? 1; const pageNum = interaction.options.getInteger('page') ?? 1;
return interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor).setTitle(`${user.username}'s punishment history`).setDescription(`**ID:** \`${user.id}\``).setFooter({text: `${userPunishment.length} total punishments. Viewing page ${pageNum} out of ${Math.ceil(userPunishment.length/6)}.`}).addFields(userPunishment.slice((pageNum - 1) * 6, pageNum * 6))]}); return interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor).setTitle(`${user.username}'s punishment history`).setDescription(`**ID:** \`${user.id}\``).setFooter({text: `${userPunishment.length} total punishments. Viewing page ${pageNum} out of ${Math.ceil(userPunishment.length/6)}.`}).addFields(userPunishment.slice((pageNum - 1) * 6, pageNum * 6))]});
} }
@ -51,10 +51,10 @@ export default {
.setDescription('Retrieve case information or user\'s punishment history') .setDescription('Retrieve case information or user\'s punishment history')
.addSubcommand((opt)=>opt .addSubcommand((opt)=>opt
.setName('view') .setName('view')
.setDescription('View a single case.') .setDescription('View a multiple or single case')
.addIntegerOption((optt)=>optt .addIntegerOption((optt)=>optt
.setName('id') .setName('id')
.setDescription('Case #') .setDescription('Case ID')
.setRequired(true))) .setRequired(true)))
.addSubcommand((opt)=>opt .addSubcommand((opt)=>opt
.setName('member') .setName('member')
@ -71,7 +71,7 @@ export default {
.setDescription('Update the case with new reason') .setDescription('Update the case with new reason')
.addIntegerOption((optt)=>optt .addIntegerOption((optt)=>optt
.setName('id') .setName('id')
.setDescription('Case # to be updated') .setDescription('Case ID to be updated')
.setRequired(true)) .setRequired(true))
.addStringOption((optt)=>optt .addStringOption((optt)=>optt
.setName('reason') .setName('reason')

View File

@ -16,5 +16,5 @@ export default {
}, },
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName('contributors') .setName('contributors')
.setDescription('List of people who contributed to the bot.') .setDescription('List of people who contributed to the bot')
} }

View File

@ -61,7 +61,7 @@ export default {
}, },
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName('suggest') .setName('suggest')
.setDescription('Want to suggest ideas/thoughts to bot techs? Suggest it here.') .setDescription('Want to suggest ideas/thoughts to bot techs? Suggest it here')
.addSubcommand((opt)=>opt .addSubcommand((opt)=>opt
.setName('your') .setName('your')
.setDescription('What do you want to suggest?') .setDescription('What do you want to suggest?')
@ -75,24 +75,24 @@ export default {
.setDescription('If your idea seems complicated or prefer to show what your idea may look like then attach the image.'))) .setDescription('If your idea seems complicated or prefer to show what your idea may look like then attach the image.')))
.addSubcommand((opt)=>opt .addSubcommand((opt)=>opt
.setName('approve') .setName('approve')
.setDescription('[Bot Tech] Approve the suggestions sent by users.') .setDescription('[Bot Tech] Approve the suggestion sent by the user')
.addStringOption(id=>id .addStringOption(id=>id
.setName('id') .setName('id')
.setDescription('User\'s suggestion ID') .setDescription('User\'s suggestion ID')
.setRequired(true)) .setRequired(true))
.addStringOption(m=>m .addStringOption(m=>m
.setName('message') .setName('message')
.setDescription('(Optional) Include a message with your approval.') .setDescription('(Optional) Include a message with your approval')
.setMaxLength(256))) .setMaxLength(256)))
.addSubcommand((opt)=>opt .addSubcommand((opt)=>opt
.setName('reject') .setName('reject')
.setDescription('[Bot Tech] Reject the suggestions sent by users.') .setDescription('[Bot Tech] Reject the suggestion sent by the user')
.addStringOption(id=>id .addStringOption(id=>id
.setName('id') .setName('id')
.setDescription('User\'s suggestion ID') .setDescription('User\'s suggestion ID')
.setRequired(true)) .setRequired(true))
.addStringOption(m=>m .addStringOption(m=>m
.setName('message') .setName('message')
.setDescription('(Optional) Include a message with your rejection.') .setDescription('(Optional) Include a message with your rejection')
.setMaxLength(256))) .setMaxLength(256)))
} }

View File

@ -14,7 +14,7 @@ export default {
.setDescription('Remove the active punishment from a member') .setDescription('Remove the active punishment from a member')
.addIntegerOption((opt)=>opt .addIntegerOption((opt)=>opt
.setName('case_id') .setName('case_id')
.setDescription('Case # of the punishment to be overwritten') .setDescription('Case ID of the punishment to be overwritten')
.setRequired(true)) .setRequired(true))
.addStringOption((opt)=>opt .addStringOption((opt)=>opt
.setName('reason') .setName('reason')