Skip to content

Latest commit

 

History

History
342 lines (229 loc) · 9.29 KB

API.md

File metadata and controls

342 lines (229 loc) · 9.29 KB

API Reference

Table of Contents

SlackUtils (preflight class)

No description

Constructor

new(): SlackUtils

Properties

No properties

Methods

Signature Description
static inflight post(body: Json, token: str): Json No description

Message (inflight class)

Represents a Message block see: https://api.slack.com/block-kit

Constructor

new(): Message

Properties

Name Type Description
sections MutArray
No description

Methods

Signature Description
inflight addSection(section: Section): void No description
inflight toJson(): Json Returns Json representation of message

App (preflight class)

No description

Constructor

new(props: AppProps): App

Properties

Name Type Description
api Api No description

Methods

Signature Description
inflight channel(id: str): Channel Retrieve a channel object from a channel Id or name
onEvent(eventName: str, handler: inflight (EventContext, Json): Json?): void Register an event handler (for available events see: https://api.slack.com/events)

Channel (inflight class)

Represents the context of a slack channel

Constructor

new(): Channel

Properties

Name Type Description
id str The channel id

Methods

Signature Description
inflight post(message: str): Json Post raw text to a channel
inflight postMessage(message: Message): Json Post a message block to a channel

EventContext (inflight class)

Represents the context of an event callback

Constructor

new(): EventContext

Properties

Name Type Description
channel Channel No description
thread Thread No description

Methods

No methods

EventContext_Mock (inflight class)

Internally used for mocking event context

Constructor

new(): EventContext_Mock

Properties

Name Type Description
channel Channel No description
thread Thread No description

Methods

No methods

MockChannel (inflight class)

Only used for internal testing

Constructor

new(): MockChannel

Properties

Name Type Description
id str The channel id

Methods

Signature Description
inflight post(message: str): Json No description
inflight postMessage(message: Message): Json No description

Thread (inflight class)

Represents the context of a slack thread

Constructor

new(): Thread

Properties

Name Type Description
channel Channel The channel context
timestamp str The thread timestamp

Methods

Signature Description
inflight post(message: str): Json Post raw text to a thread
inflight postMessage(message: Message): Json Post a message to a thread

IThread (interface)

The bahvioral interface of a thread

Properties

No properties

Methods

Signature Description
inflight post(message: str): Json No description
inflight postMessage(message: Message): Json No description

Block (struct)

No description

Properties

Name Type Description
fields Array No description
type BlockType No description

Field (struct)

No description

Properties

Name Type Description
text str No description
type FieldType No description

Section (struct)

No description

Properties

Name Type Description
fields Array No description

AppProps (struct)

Properties for Slack bot

Properties

Name Type Description
ignoreBots bool? Whether events from bot users should be ignored (default: true)
token Secret The token secret to use for the app

CallbackEvent (struct)

No description

Properties

Name Type Description
app_id str? No description
bot_id str? No description
channel str No description
event_ts str No description
team str? No description
ts str No description
type str No description
user str No description

MessageCallbackEvent (struct)

No description

Properties

Name Type Description
app_id str? No description
bot_id str? No description
channel str No description
event_ts str No description
team str? No description
text str No description
ts str No description
type str No description
user str No description

SlackEvent (struct)

No description

Properties

Name Type Description
type str No description

VerificationEvent (struct)

No description

Properties

Name Type Description
challenge str No description
token str No description
type str No description

BlockType (enum)

No description

Values

Name Description
section No description

FieldType (enum)

No description

Values

Name Description
plain_text No description
mrkdwn No description