Represents the base structure for Twitter (X) Actions.

interface TwitterAction<TActionSchema extends TwitterActionSchemaAny> {
    argsSchema: TActionSchema;
    description: string;
    func:
        | (client: TwitterApi, args: TypeOf<TActionSchema>) => Promise<string>
        | (args: TypeOf<TActionSchema>) => Promise<string>;
    name: string;
}

Type Parameters

Implemented by

Properties

argsSchema: TActionSchema

Schema for validating action arguments

description: string

A description of what the action does

func:
    | (client: TwitterApi, args: TypeOf<TActionSchema>) => Promise<string>
    | (args: TypeOf<TActionSchema>) => Promise<string>

The function to execute for this action

name: string

The name of the action.