Hook

Hook

Hook (e.g., webhook)

Constructor

new Hook(config, sourcePath)

Source:

Initializes a new Hook

Parameters:
Name Type Description
config Object

Hook configuration object

Properties
Name Type Attributes Default Description
name String

Hook name

description String <optional>
''

Hook description

context String <optional>
'global'

Hook context

init function

function that initializes the Hook on the Esdi server

enable function <optional>
() => {}

function that runs before enabling the Hook for a context

disable function <optional>
() => {}

function that runs before disabling the Hook for a context

sourcePath String

full path of Hook source file

Members

(static) github-redeploy :Hook

Source:
Tutorials:
Properties:
Name Type Description
initConfig Object

init function configuration object

Properties
Name Type Description
server Esdi

Esdi server instance

Redeploys the Esdi instance after receiving a GitHub webhook

POST: /hook/github-redeploy

Type:

(static) ko-fi :Hook

Source:
Tutorials:
Properties:
Name Type Description
initConfig Object

init function configuration object

Properties
Name Type Description
server Esdi

Esdi server instance

Converts a Ko-fi webhook into a discord.js MessageEmbed and posts it in a channel

POST: /hook/ko-fi/{channel}

Type:

Methods

(async) checkEnabledForContext(config) → {external:Guild|external:Channel|String|Object}

Source:

Returns a context if this Hook is enabled for a provided context ID, or a hapi response object if not

Parameters:
Name Type Description
config Object

configuration object

Properties
Name Type Description
h Object

hapi response toolkit

server Esdi

Esdi server instance

contextId String

discord.js Guild or Channel ID

contextType String

context type

Returns:

hapi response object or Hook context

Type
external:Guild | external:Channel | String | Object