role_button

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateRoleButtonCommand = discord.SlashCommandCreate{
	Name: "create-role-button",
	NameLocalizations: map[discord.Locale]string{
		discord.LocaleNorwegian: "lag-rolleknapp",
	},
	Description: "Create a button that assigns a role to the user when clicked.",
	DescriptionLocalizations: map[discord.Locale]string{
		discord.LocaleNorwegian: "Lag ein knapp som gjev brukaren ei rolle når han vert trykt på.",
	},

	Contexts:                 []discord.InteractionContextType{discord.InteractionContextTypeGuild},
	DefaultMemberPermissions: omit.NewPtr(discord.PermissionManageRoles),
	IntegrationTypes:         []discord.ApplicationIntegrationType{discord.ApplicationIntegrationTypeGuildInstall},

	Options: []discord.ApplicationCommandOption{
		discord.ApplicationCommandOptionRole{
			Name: "role",
			NameLocalizations: map[discord.Locale]string{
				discord.LocaleNorwegian: "rolle",
			},
			Description: "The role to assign to the user.",
			DescriptionLocalizations: map[discord.Locale]string{
				discord.LocaleNorwegian: "Rollen som skal gjevast til brukaren.",
			},
			Required: true,
		},
		discord.ApplicationCommandOptionString{
			Name: "instructions",
			NameLocalizations: map[discord.Locale]string{
				discord.LocaleNorwegian: "instruksjonar",
			},
			Description: "Instructions to display to the user above the button.",
			DescriptionLocalizations: map[discord.Locale]string{
				discord.LocaleNorwegian: "Instruksjonar som skal visast til brukaren over knappen.",
			},
			Required: false,
		},
		discord.ApplicationCommandOptionString{
			Name: "text",
			NameLocalizations: map[discord.Locale]string{
				discord.LocaleNorwegian: "tekst",
			},
			Description: "The text to display on the button.",
			DescriptionLocalizations: map[discord.Locale]string{
				discord.LocaleNorwegian: "Teksten som skal visast på knappen.",
			},
			Required: false,
		},
	},
}

Functions

func CreateRoleButtonHandler

func CreateRoleButtonHandler(e *handler.CommandEvent) error

func RoleAssignButtonHandler

func RoleAssignButtonHandler(e *handler.ComponentEvent) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL