From 9e33bd6885b4f7f7aca5af7eb00b3447917c7247 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Mon, 24 Apr 2023 20:10:11 +1000 Subject: [PATCH] Tweak? --- src/commands/ban.ts | 6 +++--- src/commands/bannedWords.ts | 10 +++++----- src/commands/bonk.ts | 4 ++-- src/commands/case.ts | 14 +++++++------- src/commands/dev.ts | 22 +++++++++++----------- src/commands/faq.ts | 2 +- src/commands/kick.ts | 4 ++-- src/commands/mp.ts | 12 ++++++------ src/commands/mute.ts | 6 +++--- src/commands/purge.ts | 4 ++-- src/commands/rank.ts | 6 +++--- src/commands/roleinfo.ts | 2 +- src/commands/softban.ts | 4 ++-- src/commands/suggest.ts | 19 ++++++++++++------- src/commands/unpunish.ts | 4 ++-- src/commands/warn.ts | 4 ++-- src/commands/whois.ts | 2 +- 17 files changed, 65 insertions(+), 60 deletions(-) diff --git a/src/commands/ban.ts b/src/commands/ban.ts index 5cc1016..a9012db 100644 --- a/src/commands/ban.ts +++ b/src/commands/ban.ts @@ -7,14 +7,14 @@ export default { data: new SlashCommandBuilder() .setName('ban') .setDescription('Ban a member from the server') - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('member') .setDescription('Which member to ban?') .setRequired(true)) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('time') .setDescription('How long the ban will be?')) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('reason') .setDescription('Reason for the ban')) } \ No newline at end of file diff --git a/src/commands/bannedWords.ts b/src/commands/bannedWords.ts index 074c9f5..92b7227 100644 --- a/src/commands/bannedWords.ts +++ b/src/commands/bannedWords.ts @@ -28,20 +28,20 @@ export default { data: new SlashCommandBuilder() .setName('bannedwords') .setDescription('description placeholder') - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('view') .setDescription('View the list of currently banned words')) - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('add') .setDescription('Add the word to the list') - .addStringOption((optt)=>optt + .addStringOption(optt=>optt .setName('word') .setDescription('Add the specific word to automod\'s bannedWords database') .setRequired(true))) - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('remove') .setDescription('Remove the word from the list') - .addStringOption((optt)=>optt + .addStringOption(optt=>optt .setName('word') .setDescription('Remove the specific word from automod\'s bannedWords list') .setRequired(true))) diff --git a/src/commands/bonk.ts b/src/commands/bonk.ts index dfdfdbe..bee42cd 100644 --- a/src/commands/bonk.ts +++ b/src/commands/bonk.ts @@ -18,11 +18,11 @@ export default { data: new SlashCommandBuilder() .setName('bonk') .setDescription('Bonk a member') - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('member') .setDescription('Which member to bonk?') .setRequired(true)) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('reason') .setDescription('Reason for the bonk')) } diff --git a/src/commands/case.ts b/src/commands/case.ts index 1e01378..4c7333f 100644 --- a/src/commands/case.ts +++ b/src/commands/case.ts @@ -49,31 +49,31 @@ export default { data: new SlashCommandBuilder() .setName('case') .setDescription('Retrieve case information or user\'s punishment history') - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('view') .setDescription('View a multiple or single case') .addIntegerOption((optt)=>optt .setName('id') .setDescription('Case ID') .setRequired(true))) - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('member') .setDescription('View member\'s punishment history') - .addUserOption((optt)=>optt + .addUserOption(optt=>optt .setName('user') .setDescription('Which user do you want to view their punishment history?') .setRequired(true)) - .addIntegerOption((optt)=>optt + .addIntegerOption(optt=>optt .setName('page') .setDescription('Select the page number'))) - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('update') .setDescription('Update the case with new reason') - .addIntegerOption((optt)=>optt + .addIntegerOption(optt=>optt .setName('id') .setDescription('Case ID to be updated') .setRequired(true)) - .addStringOption((optt)=>optt + .addStringOption(optt=>optt .setName('reason') .setDescription('New reason for the case') .setRequired(true))) diff --git a/src/commands/dev.ts b/src/commands/dev.ts index b94439a..fbe01a8 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -126,33 +126,33 @@ export default { data: new SlashCommandBuilder() .setName('dev') .setDescription('Developer commands') - .addSubcommand((optt)=>optt + .addSubcommand(optt=>optt .setName('eval') .setDescription('Execute the code to the bot') .addStringOption((opt)=>opt .setName('code') .setDescription('Execute your code') .setRequired(true))) - .addSubcommand((optt)=>optt + .addSubcommand(optt=>optt .setName('logs') .setDescription('Retrieve the logs from host and sends it to dev server')) - .addSubcommand((optt)=>optt + .addSubcommand(optt=>optt .setName('restart') .setDescription('Restart the bot for technical reasons')) - .addSubcommand((optt)=>optt + .addSubcommand(optt=>optt .setName('update') .setDescription('Pull from repository and restart')) - .addSubcommand((optt)=>optt + .addSubcommand(optt=>optt .setName('statsgraph') .setDescription('Edit the number of data points to pull') - .addIntegerOption((hiTae)=>hiTae + .addIntegerOption(hiTae=>hiTae .setName('number') .setDescription('Number of data points to pull') .setRequired(true))) - .addSubcommand((optt)=>optt + .addSubcommand(optt=>optt .setName('presence') .setDescription('Update the bot\'s presence') - .addIntegerOption((hiTae)=>hiTae + .addIntegerOption(hiTae=>hiTae .setName('type') .setDescription('Set an activity type') .addChoices( @@ -162,13 +162,13 @@ export default { {name: 'Watching', value: Discord.ActivityType.Watching}, {name: 'Competing in', value: Discord.ActivityType.Competing} )) - .addStringOption((hiAgain)=>hiAgain + .addStringOption(hiAgain=>hiAgain .setName('name') .setDescription('Set a message for the activity status')) - .addStringOption((hiAgainx2)=>hiAgainx2 + .addStringOption(hiAgainx2=>hiAgainx2 .setName('url') .setDescription('Set an url for streaming status')) - .addStringOption((hiAgainx3)=>hiAgainx3 + .addStringOption(hiAgainx3=>hiAgainx3 .setName('status') .setDescription('Set a status indicator for the bot') .setChoices( diff --git a/src/commands/faq.ts b/src/commands/faq.ts index dedd0fc..fbbdc83 100644 --- a/src/commands/faq.ts +++ b/src/commands/faq.ts @@ -15,7 +15,7 @@ export default { data: new SlashCommandBuilder() .setName('faq') .setDescription('List of questions, e.g; log file for FS, YT Scams and etc.') - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('question') .setDescription('What question do you want answered?') .setRequired(true) diff --git a/src/commands/kick.ts b/src/commands/kick.ts index c2548ab..8eac9ad 100644 --- a/src/commands/kick.ts +++ b/src/commands/kick.ts @@ -7,11 +7,11 @@ export default { data: new SlashCommandBuilder() .setName('kick') .setDescription('Boot a member from the server') - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('member') .setDescription('Which member to kick?') .setRequired(true)) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('reason') .setDescription('Reason for the kick')) } \ No newline at end of file diff --git a/src/commands/mp.ts b/src/commands/mp.ts index 9812470..e6523fd 100644 --- a/src/commands/mp.ts +++ b/src/commands/mp.ts @@ -267,22 +267,22 @@ export default { data: new SlashCommandBuilder() .setName('mp') .setDescription('Display MP status and other things') - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('status') .setDescription('Check server status and details')) - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('players') .setDescription('Check who\'s playing on the server')) - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('info') .setDescription('Provides you with server information such as filters and so on')) - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('url') .setDescription('View the URL for this server\'s FSMP server or update the URL') - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('address') .setDescription('Insert a \'dedicated-server-stats\' URL')))/* - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('series') .setDescription('Step-by-step on joining Daggerwin\'s MP series'))*/ } diff --git a/src/commands/mute.ts b/src/commands/mute.ts index a84cf1a..3469189 100644 --- a/src/commands/mute.ts +++ b/src/commands/mute.ts @@ -7,14 +7,14 @@ export default { data: new SlashCommandBuilder() .setName('mute') .setDescription('Mute a member') - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('member') .setDescription('Which member to mute?') .setRequired(true)) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('time') .setDescription('Mute duration')) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('reason') .setDescription('Reason for the mute')) } \ No newline at end of file diff --git a/src/commands/purge.ts b/src/commands/purge.ts index 7255d1c..f49eaa3 100644 --- a/src/commands/purge.ts +++ b/src/commands/purge.ts @@ -25,11 +25,11 @@ export default { data: new SlashCommandBuilder() .setName('purge') .setDescription('Purge the amount of messages in this channel') - .addIntegerOption((opt)=>opt + .addIntegerOption(opt=>opt .setName('amount') .setDescription('Amount of messages to be obliterated') .setRequired(true)) - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('user') .setDescription('Which user to have their messages obliterated?')) } \ No newline at end of file diff --git a/src/commands/rank.ts b/src/commands/rank.ts index 3e3450b..ccda1c1 100644 --- a/src/commands/rank.ts +++ b/src/commands/rank.ts @@ -162,13 +162,13 @@ export default { data: new SlashCommandBuilder() .setName('rank') .setDescription('Level system') - .addSubcommand((optt)=>optt + .addSubcommand(optt=>optt .setName('view') .setDescription('View your rank or someone else\'s rank') - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('member') .setDescription('Which member do you want to view?'))) - .addSubcommand((optt)=>optt + .addSubcommand(optt=>optt .setName('leaderboard') .setDescription('View top 10 users on leaderboard')) } \ No newline at end of file diff --git a/src/commands/roleinfo.ts b/src/commands/roleinfo.ts index e29c949..503fd0b 100644 --- a/src/commands/roleinfo.ts +++ b/src/commands/roleinfo.ts @@ -16,7 +16,7 @@ export default { data: new SlashCommandBuilder() .setName('roleinfo') .setDescription('View information about the selected role') - .addRoleOption((opt)=>opt + .addRoleOption(opt=>opt .setName('role') .setDescription('Role name to view information') .setRequired(true)) diff --git a/src/commands/softban.ts b/src/commands/softban.ts index b8b6fb2..6abaab2 100644 --- a/src/commands/softban.ts +++ b/src/commands/softban.ts @@ -7,11 +7,11 @@ export default { data: new SlashCommandBuilder() .setName('softban') .setDescription('Softban a member from the server') - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('member') .setDescription('Which member to softban?') .setRequired(true)) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('reason') .setDescription('Reason for the softban')) } \ No newline at end of file diff --git a/src/commands/suggest.ts b/src/commands/suggest.ts index aede0a0..e7679c7 100644 --- a/src/commands/suggest.ts +++ b/src/commands/suggest.ts @@ -6,6 +6,7 @@ export default { const suggestionIDReply = interaction.options.getString('id'); const suggestionID = (Math.random() + 1).toString(36).substring(5); const userid = (await client.suggestion._content.findById(suggestionIDReply))?.user._id; + const theirIdea = (await client.suggestion._content.findById(suggestionIDReply))?.idea; const timeFormatting = client.moment().format('DD/MM/YY h:mm A'); const stateChanged = 'Suggestion state has been successfully updated and DM is sent.'; ({ @@ -32,26 +33,30 @@ export default { interaction.reply({content: `Suggestion sent, here is your suggestion ID to take note of it: \`${suggestionID}\``, ephemeral: true}) }, approve: async()=>{ - if (!interaction.member.roles.cache.has(client.config.mainServer.roles.bottech)) return client.youNeedRole(interaction, 'bottech'); + if (client.config.mainServer.id === interaction.guildId) { + if (!interaction.member.roles.cache.has(client.config.mainServer.roles.bottech)) return client.youNeedRole(interaction, 'bottech'); + } if ((await client.suggestion._content.findById(suggestionIDReply)).state == 'Rejected') return interaction.reply({content: 'This suggestion\'s state is locked and cannot be modified.', ephemeral: true}); (await client.users.fetch(userid)).send({embeds: [new client.embed() .setColor(client.config.embedColorGreen) .setAuthor({name: interaction.user.tag, iconURL: interaction.user.avatarURL({size: 256})}) .setTitle('Your suggestion has been approved.') - .setDescription(`> **Their message:**\n${replyInDM.length == null ? '*No message from them.*' : replyInDM}`) + .setDescription(`> **Your suggestion:**\n${theirIdea}\n> **Their message:**\n${replyInDM.length == null ? '*No message from them.*' : replyInDM}`) .setFooter({text: `Timestamp: ${timeFormatting} | Suggestion ID: ${suggestionIDReply}`}) ]}); await client.suggestion._content.findByIdAndUpdate(suggestionIDReply, {state: 'Approved'}); return interaction.reply({embeds:[new client.embed().setColor(client.config.embedColorGreen).setTitle(`Suggestion approved | ${suggestionIDReply}`).setDescription(stateChanged)]}); }, reject: async()=>{ - if (!interaction.member.roles.cache.has(client.config.mainServer.roles.bottech)) return client.youNeedRole(interaction, 'bottech'); + if (client.config.mainServer.id === interaction.guildId) { + if (!interaction.member.roles.cache.has(client.config.mainServer.roles.bottech)) return client.youNeedRole(interaction, 'bottech'); + } if ((await client.suggestion._content.findById(suggestionIDReply)).state == 'Approved') return interaction.reply({content: 'This suggestion\'s state is locked and cannot be modified.', ephemeral: true}); (await client.users.fetch(userid)).send({embeds: [new client.embed() .setColor(client.config.embedColorRed) .setAuthor({name: interaction.user.tag, iconURL: interaction.user.avatarURL({size: 256})}) .setTitle('Your suggestion has been rejected.') - .setDescription(`> **Their message:**\n${replyInDM?.length == null ? '*No message from them.*' : replyInDM}`) + .setDescription(`> **Your suggestion:**\n${theirIdea}\n> **Their message:**\n${replyInDM.length == null ? '*No message from them.*' : replyInDM}`) .setFooter({text: `Timestamp: ${timeFormatting} | Suggestion ID: ${suggestionIDReply}`}) ]}); await client.suggestion._content.findByIdAndUpdate(suggestionIDReply, {state: 'Rejected'}); @@ -62,7 +67,7 @@ export default { data: new SlashCommandBuilder() .setName('suggest') .setDescription('Want to suggest ideas/thoughts to bot techs? Suggest it here') - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('your') .setDescription('What do you want to suggest?') .addStringOption(s=>s @@ -73,7 +78,7 @@ export default { .addAttachmentOption(i=>i .setName('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') .setDescription('[Bot Tech] Approve the suggestion sent by the user') .addStringOption(id=>id @@ -84,7 +89,7 @@ export default { .setName('message') .setDescription('(Optional) Include a message with your approval') .setMaxLength(256))) - .addSubcommand((opt)=>opt + .addSubcommand(opt=>opt .setName('reject') .setDescription('[Bot Tech] Reject the suggestion sent by the user') .addStringOption(id=>id diff --git a/src/commands/unpunish.ts b/src/commands/unpunish.ts index 0265838..7857fbc 100644 --- a/src/commands/unpunish.ts +++ b/src/commands/unpunish.ts @@ -12,11 +12,11 @@ export default { data: new SlashCommandBuilder() .setName('unpunish') .setDescription('Remove the active punishment from a member') - .addIntegerOption((opt)=>opt + .addIntegerOption(opt=>opt .setName('case_id') .setDescription('Case ID of the punishment to be overwritten') .setRequired(true)) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('reason') .setDescription('Reason for removing the punishment')) } \ No newline at end of file diff --git a/src/commands/warn.ts b/src/commands/warn.ts index 93279e2..f764b7f 100644 --- a/src/commands/warn.ts +++ b/src/commands/warn.ts @@ -7,11 +7,11 @@ export default { data: new SlashCommandBuilder() .setName('warn') .setDescription('Warn a member') - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('member') .setDescription('Which member to warn?') .setRequired(true)) - .addStringOption((opt)=>opt + .addStringOption(opt=>opt .setName('reason') .setDescription('Reason for the warning') .setRequired(false)) diff --git a/src/commands/whois.ts b/src/commands/whois.ts index 5a2e903..8bbdb50 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -53,7 +53,7 @@ export default { data: new SlashCommandBuilder() .setName('whois') .setDescription('View your own or someone else\'s information') - .addUserOption((opt)=>opt + .addUserOption(opt=>opt .setName('member') .setDescription('Member or user to view their information') .setRequired(true))