1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-27 20:35:38 -05:00
This commit is contained in:
toast-ts 2023-04-24 20:10:11 +10:00
parent 1f81194111
commit 828024894e
17 changed files with 65 additions and 60 deletions

View File

@ -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'))
}

View File

@ -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)))

View File

@ -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'))
}

View File

@ -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)))

View File

@ -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(

View File

@ -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)

View File

@ -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'))
}

View File

@ -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'))*/
}

View File

@ -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'))
}

View File

@ -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?'))
}

View File

@ -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'))
}

View File

@ -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))

View File

@ -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'))
}

View File

@ -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

View File

@ -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'))
}

View File

@ -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))

View File

@ -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))