UNPKG

@shgysk8zer0/slack

Version:

An npm package for sending messages in Slack

37 lines (28 loc) 478 B
'use strict'; var base = require('../base.cjs'); class SlackBlock extends base.SlackBase { #id; constructor({ id } = {}) { super(); if (typeof id === 'string') { this.#id = id; } } get id() { return this.#id; } set id(val) { if (typeof id === 'string') { this.#id = val; } else { throw new TypeError('id must be a string.'); } } toJSON() { return { ...super.toJSON(), block_id: this.#id, }; } } exports.SlackBlock = SlackBlock;