
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@synonymdev/blocktank-util-slack-client
Advanced tools
Client to interact with the blocktank-util-slack service.
import { SlackClient } from '@synonymdev/blocktank-util-slack-client';
const client = new SlackClient('myConfiguredChannelName') // See service config for channel names.
await client.info('myTitle', 'myMessage') // Send message.
If the channel name is empty, the message will be logged to the console instead of sent to slack.
Messages can be ratelimited to not overwhelm the channel. The rate limit is based on a key. If the key was already seen within the limitFor
duration, the message will be ignored.
interface RateLimitOptions {
// Key of the operation that will be rate limited. Example: `blocktank-instant:funds-are-low`.
key: string,
// Duration of the rate limit until the next message can be sent.
limitFor: Duration
}
// Amount of time the limit should be applied for this key.
interface Duration {
years?: number;
months?: number;
weeks?: number;
days?: number;
hours?: number;
minutes?: number;
seconds?: number;
}
Let's make an example:
await client.error('Couldnt read file', 'errorMessage', {
key: 'blocktank-ls-btc:fileReadKey',
limitFor: {
hours: 1
}
})
This will send a message with the level error
and the title Couldnt read file
.
The message will be sent only if the last message with the key blocktank-ls-btc:fileReadKey
was sent more than 1 hour ago.
If the last message was sent less than 1 hour ago, the message will be ignored.
SlackMessageLevel | Emoji |
---|---|
debug | |
success | ✅ |
info | ℹ️ |
notice | 📢 |
warning | ⚠️ |
error | ❌ |
critical | ‼️ |
alert | 🚨 |
emergency | 🆘 |
Execute npx blocktank-util-slack-cli
in the terminal to send test messages. Make sure you install this package first.
package.json
.CHANGELOG.md
.git tag v0.1.0
.git push origin v0.1.0
.npm publish
.FAQs
Blocktank Slack client
The npm package @synonymdev/blocktank-util-slack-client receives a total of 0 weekly downloads. As such, @synonymdev/blocktank-util-slack-client popularity was classified as not popular.
We found that @synonymdev/blocktank-util-slack-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.