(interaction)
| 374 | } |
| 375 | |
| 376 | export async function handleLoggingMenuSelect(interaction) { |
| 377 | if (!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)) { |
| 378 | return interaction.reply({ |
| 379 | content: '❌ You need **Manage Server** permissions to use this.', |
| 380 | ephemeral: true, |
| 381 | }); |
| 382 | } |
| 383 | |
| 384 | const value = interaction.values[0]; |
| 385 | |
| 386 | if (value.startsWith('set:')) { |
| 387 | const destination = value.replace('set:', ''); |
| 388 | return showChannelModal(interaction, destination); |
| 389 | } |
| 390 | |
| 391 | if (value.startsWith('clear:')) { |
| 392 | const destination = value.replace('clear:', ''); |
| 393 | await setLogChannel(interaction.client, interaction.guildId, destination, null); |
| 394 | const { embed, components } = await buildLoggingDashboardView(interaction, interaction.client); |
| 395 | return interaction.update({ |
| 396 | embeds: [embed], |
| 397 | components, |
| 398 | content: null, |
| 399 | }); |
| 400 | } |
| 401 | |
| 402 | if (value === 'view:categories') { |
| 403 | const { embed, components } = await buildLoggingCategoriesView(interaction, interaction.client); |
| 404 | return interaction.update({ embeds: [embed], components, content: null }); |
| 405 | } |
| 406 | |
| 407 | if (value === 'view:filters') { |
| 408 | const { embed, components } = await buildLoggingFilterView(interaction, interaction.client); |
| 409 | return interaction.update({ embeds: [embed], components, content: null }); |
| 410 | } |
| 411 | |
| 412 | return interaction.reply({ content: '❌ Unknown option.', ephemeral: true }); |
| 413 | } |
nothing calls this directly
no test coverage detected