diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-04 10:05:14 -0500 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-04 10:05:14 -0500 |
| commit | cc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a (patch) | |
| tree | deffb57bee9fe24a8d1b8143fba603774544ee00 /bot/src/commands/settings.js | |
| parent | 11bb9ab6b30314d91209bc9888d95783cc247e98 (diff) | |
| download | AleeBot-cc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a.tar.gz AleeBot-cc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a.tar.bz2 AleeBot-cc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a.zip | |
Readme change; Docker; Logging
Diffstat (limited to 'bot/src/commands/settings.js')
| -rw-r--r-- | bot/src/commands/settings.js | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/bot/src/commands/settings.js b/bot/src/commands/settings.js index 5d32a67..00f7caf 100644 --- a/bot/src/commands/settings.js +++ b/bot/src/commands/settings.js @@ -1,4 +1,5 @@ -import { MessageFlags, PermissionFlagsBits, SlashCommandBuilder } from 'discord.js'; +import { EmbedBuilder, MessageFlags, PermissionFlagsBits, SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, ComponentType } from 'discord.js'; +import { abEmbedColour } from '../storage/consts.js'; export default { data: new SlashCommandBuilder() @@ -14,13 +15,65 @@ export default { .setDescription('Change settings for the user.')), async execute(interaction) { if (interaction.options.getSubcommand() === 'guild') { - if (!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)) return await interaction.reply({ content: 'You do not have the permission to manage this guild.', flags: MessageFlags.Ephemeral }); + //if (!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)) return await interaction.reply({ content: 'You do not have the permission to manage this guild.', flags: MessageFlags.Ephemeral }); - return await interaction.reply('recieved'); + const logging = new ButtonBuilder() + .setCustomId('logging') + .setLabel('Logging') + .setStyle(ButtonStyle.Primary); + + const suggestions = new ButtonBuilder() + .setCustomId('suggestions') + .setLabel('Suggestions') + .setStyle(ButtonStyle.Primary); + + const row = new ActionRowBuilder() + .addComponents(logging, suggestions); + + const guildEmbed = new EmbedBuilder() + .setAuthor({ name: 'AleeBot Guild Settings', iconURL: interaction.client.user.avatarURL() }) + .setDescription('Select the options') + .addFields( + { name: 'Logging', value: 'logchannel', inline: true }, + { name: 'Suggestions', value: 'channel', inline: true }, + { name: 'LLM Chatbot', value: 'Enabled', inline: true }, + { name: 'Quote of the Day', value: 'logchannel', inline: true }, + { name: 'QOTD Channel', value: 'logchannel', inline: true } + ) + .setColor(abEmbedColour); + + const guildSetup = await interaction.reply({ embeds: [guildEmbed], components: [row] }); + + const filter = (i) => i.user.id === interaction.user.id; + + const guildCollector = guildSetup.createMessageComponentCollector({ + componentType: ComponentType.Button, + filter, + time: 1000 * 120 + }); + + guildCollector.on('collect', async (interaction) => { + if (interaction.customId === 'logging') { + await interaction.reply({ content: 'Clicked on logging' }); + } + + if (interaction.customId === 'suggestions') { + await interaction.reply({ content: 'Clicked on suggestions' }); + } + }); } if (interaction.options.getSubcommand() === 'user') { - return; + const userEmbed = new EmbedBuilder() + .setAuthor({ name: 'AleeBot User Settings', iconURL: interaction.client.user.avatarURL() }) + .setDescription('Select the options') + .addFields( + { name: 'Language', value: 'logchannel', inline: true }, + { name: 'Location', value: 'channel', inline: true } + ) + .setColor(abEmbedColour); + + return await interaction.reply({ embeds: [userEmbed] }); } } }; |
