Skip to content

Pop

Popii


Popii / Pop

Defined in: types.ts:207

The full execution context provided to command and snap handlers.

Extends EventPop with interaction-specific members: reply(), defer(), options (typed slash command arguments), input (schema-validated input), and references to the raw interaction and message objects.

Use the TInput type parameter when you supply a schema to the command — the validated result is then available as pop.input with full type inference.

async do(pop) {
await pop.reply({
embeds: [{ title: "Hello!", description: `Hey ${pop.user.username}` }],
ephemeral: true
});
}
async do(pop) {
await pop.defer();
const result = await someSlowOperation();
await pop.reply(result);
}

TState = any

TInput = any

TLocals = PopiiLocals & Record<string, any>

success(message): Promise<void>

Defined in: plugins/ui.ts:26

string

Promise<void>

EventPop.success


error(message): Promise<void>

Defined in: plugins/ui.ts:27

string

Promise<void>

EventPop.error


info(message): Promise<void>

Defined in: plugins/ui.ts:28

string

Promise<void>

EventPop.info


paginate(source, timeoutMs?): Promise<void>

Defined in: plugins/ui.ts:29

EmbedBuilder[] | { fetch: (page) => Promise<EmbedBuilder | null>; totalPages?: number; }

number

Promise<void>

EventPop.paginate


prompt(embed, buttons, timeoutMs?): Promise<string | null>

Defined in: plugins/ui.ts:30

EmbedBuilder

string[]

number

Promise<string | null>

EventPop.prompt


confirm(question, timeoutMs?): Promise<boolean>

Defined in: plugins/ui.ts:31

string

number

Promise<boolean>

EventPop.confirm


form(title, fields, timeoutMs?): Promise<Record<string, string> | null>

Defined in: plugins/ui.ts:32

string

FormField[]

number

Promise<Record<string, string> | null>

EventPop.form


awaitMessage(timeoutMs?, promptMessageId?): Promise<any>

Defined in: plugins/ui.ts:33

number

string

Promise<any>

EventPop.awaitMessage


wizard(steps, timeoutMs?): Promise<Record<string, string> | null>

Defined in: plugins/ui.ts:34

WizardStep[]

number

Promise<Record<string, string> | null>

EventPop.wizard


joinVoice(): Promise<any>

Defined in: plugins/voice.ts:12

Promise<any>

EventPop.joinVoice


playAudio(urlOrStream): Promise<{ player: any; title: string; metadata?: any; }>

Defined in: plugins/voice.ts:13

any

Promise<{ player: any; title: string; metadata?: any; }>

EventPop.playAudio


leaveVoice(): Promise<void>

Defined in: plugins/voice.ts:14

Promise<void>

EventPop.leaveVoice


getQueue(): any[]

Defined in: plugins/voice.ts:15

any[]

EventPop.getQueue


getNowPlaying(): { title: string; artist: string; duration: string; thumbnail?: string; requestedBy?: string; elapsedMs: number; elapsed: string; progress: number; } | null

Defined in: plugins/voice.ts:16

{ title: string; artist: string; duration: string; thumbnail?: string; requestedBy?: string; elapsedMs: number; elapsed: string; progress: number; } | null

EventPop.getNowPlaying


getNowPlayingCard(opts?): Promise<AttachmentBuilder | null>

Defined in: plugins/voice.ts:17

string

Promise<AttachmentBuilder | null>

EventPop.getNowPlayingCard


createAttachment(path, name?): any

Defined in: types.ts:142

string

string

any

EventPop.createAttachment


fetchJSON<T>(url, init?): Promise<T>

Defined in: types.ts:143

T = unknown

string | URL | Request

RequestInit

Promise<T>

EventPop.fetchJSON


fetchText(url, init?): Promise<string>

Defined in: types.ts:144

string | URL | Request

RequestInit

Promise<string>

EventPop.fetchText


fetchBuffer(url, init?): Promise<ArrayBuffer>

Defined in: types.ts:145

string | URL | Request

RequestInit

Promise<ArrayBuffer>

EventPop.fetchBuffer


fetchForm<T>(url, data, init?): Promise<T>

Defined in: types.ts:146

T = unknown

string | URL | Request

FormData

RequestInit

Promise<T>

EventPop.fetchForm


cache<T>(key, ttlMs, fetcher): Promise<T>

Defined in: types.ts:147

T

string

number

() => T | Promise<T>

Promise<T>

EventPop.cache


translate(key, args?): string

Defined in: types.ts:148

string

Record<string, any>

string

EventPop.translate


t(key, args?): string

Defined in: types.ts:149

string

Record<string, any>

string

EventPop.t


pack(customId, data): string

Defined in: types.ts:155

string

any

string

EventPop.pack


schedule(taskName, payload?, delayMs?): Promise<void>

Defined in: types.ts:160

string

any

number

Promise<void>

EventPop.schedule


reply(payload): Promise<any>

Defined in: types.ts:208

string | { content?: string; embeds?: any[]; components?: any[]; files?: any[]; ephemeral?: boolean; }

Promise<any>


defer(options?): Promise<void>

Defined in: types.ts:209

boolean

Promise<void>


respond(choices): Promise<void>

Defined in: types.ts:210

object[]

Promise<void>


respondFiltered(choices, userInput): Promise<void>

Defined in: types.ts:211

object[]

string

Promise<void>

ai: object

Defined in: plugins/ai.ts:10

generate(prompt): Promise<string>

string

Promise<string>

chat(history): Promise<string>

object[]

Promise<string>

EventPop.ai


canvas: object

Defined in: plugins/canvas.ts:63

create(width, height): Promise<CanvasBuilder>

number

number

Promise<CanvasBuilder>

nowPlayingCard(track, opts?): Promise<AttachmentBuilder>

NowPlayingTrack

NowPlayingCardOptions

Promise<AttachmentBuilder>


captcha: object

Defined in: plugins/captcha.ts:14

sendVerificationPanel(channelId): Promise<void>

string

Promise<void>


desk: object

Defined in: plugins/desk.ts:11

sendPanel(channelId): Promise<void>

string

Promise<void>

closeTicket(): Promise<void>

Promise<void>


economy: object

Defined in: plugins/economy.ts:16

currencyName: string

getProfile(guildId, userId): Promise<{ balance: number; last_daily: number; } | null>

string

string

Promise<{ balance: number; last_daily: number; } | null>

addBalance(guildId, userId, amount): Promise<void>

string

string

number

Promise<void>

EventPop.economy


giveaways: object

Defined in: plugins/giveaway.ts:13

start(channelId, prize, winners, durationMs): Promise<void>

string

string

number

number

Promise<void>

EventPop.giveaways


lastfm: object

Defined in: plugins/lastfm.ts:10

getAccount(userId): Promise<{ username: string; sessionKey: string; } | null>

string

Promise<{ username: string; sessionKey: string; } | null>


levels: object

Defined in: plugins/levels.ts:17

getProfile(guildId, userId): Promise<{ xp: number; level: number; } | null>

string

string

Promise<{ xp: number; level: number; } | null>

addXp(guildId, userId, amount): Promise<{ leveledUp: boolean; newLevel: number; }>

string

string

number

Promise<{ leveledUp: boolean; newLevel: number; }>

EventPop.levels


mongoose: __module

Defined in: plugins/mongoose.ts:10

EventPop.mongoose


db: Database

Defined in: plugins/sqlite.ts:8

EventPop.db


session: object

Defined in: plugins/ui.ts:35

get(key): Promise<any>

string

Promise<any>

set(key, value, ttlMs?): Promise<void>

string

any

number

Promise<void>

del(key): Promise<void>

string

Promise<void>

clear(): Promise<void>

Promise<void>

EventPop.session


sponsorblock: object

Defined in: plugins/voice.ts:18

isEnabled(): boolean

boolean

setEnabled(enabled): void

boolean

void

getCategories(): string[]

string[]

setCategories(cats): void

string[]

void

forceSkip(): Promise<boolean>

Promise<boolean>

EventPop.sponsorblock


readonly optional execution?: object

Defined in: types.ts:137

Correlation and cancellation metadata for this execution.

id: string

type: "command" | "event" | "component" | "task"

definitionId: string

startedAt: number

EventPop.execution


readonly optional signal?: AbortSignal

Defined in: types.ts:138

EventPop.signal


client: PopiiClient<TState>

Defined in: types.ts:139

EventPop.client


locale: string

Defined in: types.ts:140

EventPop.locale


log: PopLogger

Defined in: types.ts:141

EventPop.log


cooler: object

Defined in: types.ts:150

get<T>(key): Promise<T | null>

T = any

string

Promise<T | null>

set(key, value, ttlMs?): Promise<void>

string

any

number

Promise<void>

delete(key): Promise<void>

string

Promise<void>

EventPop.cooler


state: TState

Defined in: types.ts:156

EventPop.state


locals: TLocals

Defined in: types.ts:157

EventPop.locals


guild: Guild | null

Defined in: types.ts:158

EventPop.guild


channel: TextBasedChannel | null

Defined in: types.ts:159

EventPop.channel


user: User

Defined in: types.ts:212


member: GuildMember | APIInteractionGuildMember | null

Defined in: types.ts:213


options: PopOptions

Defined in: types.ts:214


input: TInput

Defined in: types.ts:215


optional interaction?: Interaction | MessageComponentInteraction<CacheType>

Defined in: types.ts:216


optional message?: Message<boolean>

Defined in: types.ts:217


optional snapMatches?: RegExpMatchArray | null

Defined in: types.ts:218


optional snapData?: any

Defined in: types.ts:219


optional targetMessage?: Message<boolean> | null

Defined in: types.ts:220


optional targetUser?: User | null

Defined in: types.ts:221