PopiiComponentDefinition
Popii / PopiiComponentDefinition
Interface: PopiiComponentDefinition<TState, TInput, TLocals>
Section titled “Interface: PopiiComponentDefinition<TState, TInput, TLocals>”Defined in: types.ts:318
The full definition of a Popii persistent component handler (Snap).
You don’t usually interact with this interface directly — use the snap builder function, which infers all types for you.
Type Parameters
Section titled “Type Parameters”TState
Section titled “TState”TState = any
TInput
Section titled “TInput”TInput = any
TLocals
Section titled “TLocals”TLocals = PopiiLocals & Record<string, any>
Methods
Section titled “Methods”do(
pop):void|Promise<void>
Defined in: types.ts:336
Parameters
Section titled “Parameters”ComponentPop<TState, TInput, TLocals>
Returns
Section titled “Returns”void | Promise<void>
Properties
Section titled “Properties”customId
Section titled “customId”customId:
string|RegExp
Defined in: types.ts:319
prefix?
Section titled “prefix?”
optionalprefix?:string
Defined in: types.ts:320
guildOnly?
Section titled “guildOnly?”
optionalguildOnly?:boolean
Defined in: types.ts:321
ownerOnly?
Section titled “ownerOnly?”
optionalownerOnly?:boolean
Defined in: types.ts:322
premium?
Section titled “premium?”
optionalpremium?:boolean
Defined in: types.ts:323
ephemeral?
Section titled “ephemeral?”
optionalephemeral?:boolean
Defined in: types.ts:324
permissions?
Section titled “permissions?”
optionalpermissions?: (bigint|"CreateInstantInvite"|"KickMembers"|"BanMembers"|"Administrator"|"ManageChannels"|"ManageGuild"|"AddReactions"|"ViewAuditLog"|"PrioritySpeaker"|"Stream"|"ViewChannel"|"SendMessages"|"SendTTSMessages"|"ManageMessages"|"EmbedLinks"|"AttachFiles"|"ReadMessageHistory"|"MentionEveryone"|"UseExternalEmojis"|"ViewGuildInsights"|"Connect"|"Speak"|"MuteMembers"|"DeafenMembers"|"MoveMembers"|"UseVAD"|"ChangeNickname"|"ManageNicknames"|"ManageRoles"|"ManageWebhooks"|"ManageEmojisAndStickers"|"ManageGuildExpressions"|"UseApplicationCommands"|"RequestToSpeak"|"ManageEvents"|"ManageThreads"|"CreatePublicThreads"|"CreatePrivateThreads"|"UseExternalStickers"|"SendMessagesInThreads"|"UseEmbeddedActivities"|"ModerateMembers"|"ViewCreatorMonetizationAnalytics"|"UseSoundboard"|"CreateGuildExpressions"|"CreateEvents"|"UseExternalSounds"|"SendVoiceMessages"|"SetVoiceChannelStatus"|"SendPolls"|"UseExternalApps"|"PinMessages"|"BypassSlowmode")[]
Defined in: types.ts:325
allowedRoles?
Section titled “allowedRoles?”
optionalallowedRoles?:string[]
Defined in: types.ts:326
deniedRoles?
Section titled “deniedRoles?”
optionaldeniedRoles?:string[]
Defined in: types.ts:327
allowedChannels?
Section titled “allowedChannels?”
optionalallowedChannels?:string[]
Defined in: types.ts:328
mutex?
Section titled “mutex?”
optionalmutex?:boolean
Defined in: types.ts:329
cooldown?
Section titled “cooldown?”
optionalcooldown?:number| {ms:number;uses?:number;scope?:"user"|"guild"|"global"; }
Defined in: types.ts:330
quota?
Section titled “quota?”
optionalquota?:object
Defined in: types.ts:331
limit:
number
timeframe
Section titled “timeframe”timeframe:
number
scope?
Section titled “scope?”
optionalscope?:"user"|"guild"|"global"
expiresIn?
Section titled “expiresIn?”
optionalexpiresIn?:number
Defined in: types.ts:332
timeoutMs?
Section titled “timeoutMs?”
optionaltimeoutMs?:number
Defined in: types.ts:333
middlewares?
Section titled “middlewares?”
optionalmiddlewares?:ComponentMiddleware<TState,TInput,TLocals>[]
Defined in: types.ts:334
schema?
Section titled “schema?”
optionalschema?:PopiiSchema<TInput>
Defined in: types.ts:335