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) {
|
func HandleModifyXpRole(_ *discordgo.Session, _ *discordgo.InteractionCreate, _ discordgo.MessageComponentInteractionData, resp *cmd.ResponseBuilder) {
|
||||||
err := resp.IsEphemeral().
|
err := resp.IsEphemeral().
|
||||||
SetMessage("Action à réaliser").
|
SetMessage("Action à réaliser").
|
||||||
SetComponents(component.New().Add(component.NewActionRow().Add(
|
SetComponents(component.New().Add(component.NewActionRow().
|
||||||
component.NewStringSelect(ModifyXpRole).SetPlaceholder("Action").
|
Add(component.NewButton(XpRoleAdd, discordgo.PrimaryButton).
|
||||||
AddOption(
|
SetLabel("Ajouter").
|
||||||
component.NewSelectOption("Ajouter", XpRoleAdd).
|
SetEmoji(&discordgo.ComponentEmoji{Name: "⬆️"}),
|
||||||
SetDescription("Ajouter un rôle à XP").
|
).
|
||||||
SetEmoji(&discordgo.ComponentEmoji{Name: "⬆️"}),
|
Add(component.NewButton(XpRoleEdit, discordgo.SecondaryButton).
|
||||||
).
|
SetLabel("Modifier").
|
||||||
AddOption(
|
SetEmoji(&discordgo.ComponentEmoji{Name: "📝"}),
|
||||||
component.NewSelectOption("Modifier", XpRoleEdit).
|
).
|
||||||
SetDescription("Modifier un rôle à XP").
|
Add(component.NewButton(XpRoleDel, discordgo.DangerButton).
|
||||||
SetEmoji(&discordgo.ComponentEmoji{Name: "📝"}),
|
SetLabel("Supprimer").
|
||||||
).
|
SetEmoji(&discordgo.ComponentEmoji{Name: "❌"}),
|
||||||
AddOption(
|
),
|
||||||
component.NewSelectOption("Supprimer", XpRoleDel).
|
)).Send()
|
||||||
SetDescription("Supprimer un rôle à XP").
|
|
||||||
SetEmoji(&discordgo.ComponentEmoji{Name: "❌"}),
|
|
||||||
),
|
|
||||||
))).Send()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Alert("config/guild.go - Sending config", err.Error())
|
logger.Alert("config/guild.go - Sending config", err.Error())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue