refactor(config): use button to select action for xp role
This commit is contained in:
parent
6d19ef42c4
commit
51a412b32d
1 changed files with 14 additions and 18 deletions
|
@ -37,24 +37,20 @@ var (
|
|||
func HandleModifyXpRole(_ *discordgo.Session, _ *discordgo.InteractionCreate, _ discordgo.MessageComponentInteractionData, resp *cmd.ResponseBuilder) {
|
||||
err := resp.IsEphemeral().
|
||||
SetMessage("Action à réaliser").
|
||||
SetComponents(component.New().Add(component.NewActionRow().Add(
|
||||
component.NewStringSelect(ModifyXpRole).SetPlaceholder("Action").
|
||||
AddOption(
|
||||
component.NewSelectOption("Ajouter", XpRoleAdd).
|
||||
SetDescription("Ajouter un rôle à XP").
|
||||
SetComponents(component.New().Add(component.NewActionRow().
|
||||
Add(component.NewButton(XpRoleAdd, discordgo.PrimaryButton).
|
||||
SetLabel("Ajouter").
|
||||
SetEmoji(&discordgo.ComponentEmoji{Name: "⬆️"}),
|
||||
).
|
||||
AddOption(
|
||||
component.NewSelectOption("Modifier", XpRoleEdit).
|
||||
SetDescription("Modifier un rôle à XP").
|
||||
Add(component.NewButton(XpRoleEdit, discordgo.SecondaryButton).
|
||||
SetLabel("Modifier").
|
||||
SetEmoji(&discordgo.ComponentEmoji{Name: "📝"}),
|
||||
).
|
||||
AddOption(
|
||||
component.NewSelectOption("Supprimer", XpRoleDel).
|
||||
SetDescription("Supprimer un rôle à XP").
|
||||
Add(component.NewButton(XpRoleDel, discordgo.DangerButton).
|
||||
SetLabel("Supprimer").
|
||||
SetEmoji(&discordgo.ComponentEmoji{Name: "❌"}),
|
||||
),
|
||||
))).Send()
|
||||
)).Send()
|
||||
if err != nil {
|
||||
logger.Alert("config/guild.go - Sending config", err.Error())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue