Skip to main content
Version: 1.2

CancelAfter

cancelAfter

Cancels a deferred function registered with after.

Example

import { cancelAfter } from 'commandkit';
// inside a command
export const chatInput: ChatInputCommand = async (ctx) => {
const id = after(() => {
console.log('This will run after the command has finished executing.');
});

// cancel the deferred function if needed
if (something) cancelAfter(id);
}
Signature
function cancelAfter(id: string): void

Parameters

id

parameter
string