bjerkio / nestjs-slack Goto Github PK
View Code? Open in Web Editor NEWLightweight library to use Slack in NestJS applications.
License: Apache License 2.0
Lightweight library to use Slack in NestJS applications.
License: Apache License 2.0
Hi. Thanks for solution!
I see that your lib can't work with webhook. Only with slack web api. Can you add this opportunity? I have a chat and i would like to send a data via webhook there.
Hello, just wondering if it's possible to add a getter to the SlackService
to allow the application to get a hold of the WebClient instance? I want to use it to make calls to users apis (lookupByEmail
for example)
Doesn't seem to be a way to do this without installing @slack/web-api
and making an external instance of the WebClient
Love the repo!
IMHO, it makes sense to replace axios with fetch.
While there is soon to be a breaking change (moving this package to v2), I think it's time to discuss when to move to pure ESM.
I know there are a lot of teams that still use CommonJS, and from what I can understand the nest community is slowly moving that way. This means we can start planning for a new major release (v3).
Feel free to add feedback on this, and maybe share a timeline for when you are going ESM! I think we will keep maintaining v2 for quite some time, regardless of when v3 comes out.
Thanks ❤️
The postMessage function from https://github.com/bjerkio/nestjs-slack/blob/main/src/slack.service.ts#L109 should return the API response to work with it, for things like sending messages to a thread instead of void.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@types/jest
, jest
, ts-jest
)@nestjs/common
, @nestjs/core
, @nestjs/testing
).github/workflows/codeql-analysis.yml
actions/checkout v3
github/codeql-action v2
github/codeql-action v2
github/codeql-action v2
.github/workflows/pull_request.yml
actions/checkout v3
actions/setup-node v3
codecov/codecov-action v3
.github/workflows/workflow.yml
actions/checkout v3
actions/setup-node v3
codecov/codecov-action v3
google-github-actions/release-please-action v3
package.json
@bjerk/eslint-config ^5.0.0
@google-cloud/logging ^10.0.1
@slack/web-api ^6
axios ^1.0.0
node-fetch ^2.6.7
slack-block-builder ^2
ts-invariant ^0.10.3
@nestjs/common ^9.0.3
@nestjs/core ^9.0.3
@nestjs/testing ^9.0.3
@simenandre/prettier ^5.0.0
@slack-wrench/jest-mock-web-client ^1.4.0
@types/jest ^28.1.5
@typescript-eslint/eslint-plugin ^6
@typescript-eslint/parser ^6
eslint ^8.20.0
eslint-config-prettier ^8.8.0
eslint-plugin-eslint-comments ^3.2.0
eslint-plugin-import ^2.27.5
eslint-plugin-jest ^27.2.3
eslint-plugin-promise ^6.1.1
eslint-plugin-unicorn ^47.0.0
husky ^8
jest ^28.1.3
lint-staged ^13.0.3
nock ^13.2.8
prettier ^2.7.1
reflect-metadata ^0.1.13
ts-jest ^28.0.5
typescript ^4.7.4
@nestjs/common >=9 <=10
@nestjs/core >=9 <=10
Hi there,
Can you please provide an example of sending a message via slackService.sendBlocks(...)
? I can't seem to get this to work. Thank you.
I'm wondering if having the Google Cloud logger as a dependency is really neccessary? It's adding a few Mb to my lambda bundle which is a bit large for a lightweight slack nestjs wrapper. Is it possible to remove that with the default nestjs logger? I feel like that would make this a bit more nestjs friendly.
Hiho @cobraz ,
how are you ?
May I ask you to kindly upgrade the dependencies to support nest v9 ?
Thank you very much in advance :)
Kind regards
Meywether
Hi everyone,
Currently, we're using the nest-slack: ^2.0.0.
Which is lacking of the API postEphemeral
from slack.
Can you guys help me exposing this function?
For those who is facing the same problem with me, I have a solution which is.
We can make it any to use the client not being exposed like this:
(this.service as any).client.chat.postEphemeral({
channel: 'some-channel',
text: 'Hello, I'm only visible to you',
user: theRequestedUserId,
});
Hi.
I hope you are well.
In the main.ts I want to pass the SlackService configuration to the global exception filter which receives that class in the constructor, but I don't understand the way to achieve this.
public async bootstrap(): Promise<INestApplication> {
this.app = await NestFactory.create(AppModule, { cors: true });
const configService = await this.app.resolve(ConfigService);
this.setGlobalFilters(configService);
await this.listen(configService.get('app.port'));
return this.app;
}
public setGlobalFilters(configService: ConfigService) {
const httpAdapter: HttpAdapterHost =
this.app.get<HttpAdapterHost>(HttpAdapterHost);
const slackService = new SlackService({
type: 'webhook',
webhookOptions: {
url: configService.get('SLACK_WEBHOOK_URL'),
},
});
this.app.useGlobalFilters(
new AllExceptionsFilter(httpAdapter, slackService),
);
}
Hiho, thanks a lot for this awesome lib!!
My question is, would it be possible to add multiple webhooks ?
Best regards Meywether
Hi @cobraz,
hope you re doing well,
i am suddenly running into this issue, and do not know why. Here are the relevant code parts.
The error and a apart of the url:
I really do not know why this is happening, because the webhook url ist valid and working...
Do you have any ideas for me ?
Kind regards
Meywether
Hi Everyone,
Hope you guys are doing great. I am using this package to send messages to the slack using SlackServide.postMessage() method. While calling it I am getting this issue. Can anyone help to resolve that issue?
Here is the sample code:
constructor(private readonly slackService: SlackService) {}
this.slackService.postMessage(payload);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.