Skip to content

Register Commands && Metadata

İbrahim edited this page Dec 15, 2025 · 2 revisions

Registering

Registering split into three pieces; commands, components and linked roles. You do need to create an instance for app.

import { MiniInteraction } from "@minesa-org/mini-interaction";

export const mini = new MiniInteraction({
	applicationId: process.env.DISCORD_APPLICATION_ID!,
	publicKey: process.env.DISCORD_APP_PUBLIC_KEY!,
});

Registering Linked Role Connection Metadata

Registering linked roles also possible with mini-interaction. It is so easy to integration either!

/* 
*  @file api/interactions.ts
*/
await mini.registerMetadata(process.env.DISCORD_BOT_TOKEN!, [
	{
		key: "is_mini",
		name: "Mini Member?",
		description: "Is the member a mini user?",
		type: RoleConnectionMetadataTypes.BooleanEqual,
	},
]);

Registering App Commands

Run the registration scripts when you deploy (manually or via a CI step). You can call registerCommands without arguments if you want to preload the commands directory automatically.

/* 
*  @file scripts/register.ts
*/
await mini.registerCommands(process.env.DISCORD_BOT_TOKEN!);

console.log("Registration complete!");

Clone this wiki locally