Skip to content

Commit cf36b3c

Browse files
authored
feat(providers): add emojis and user (#1117)
Add client.emojis and client.user as providers This commit adds these 2 new providers to make it easier to access client data as it is already done with other data
1 parent 76f08f3 commit cf36b3c

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/providers/emojis.provider.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Provider } from '@nestjs/common';
2+
import { Client, BaseGuildEmojiManager } from 'discord.js';
3+
4+
export const EmojisProvider: Provider<BaseGuildEmojiManager> = {
5+
provide: BaseGuildEmojiManager,
6+
useFactory: (client: Client) => client.emojis,
7+
inject: [Client]
8+
};

src/providers/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
export * from './application.provider';
22
export * from './channels.provider';
33
export * from './client.provider';
4+
export * from './emojis.provider';
45
export * from './guilds.provider';
56
export * from './rest.provider';
67
export * from './shard.provider';
8+
export * from './user.provider';
79
export * from './users.provider';
810
export * from './voice.provider';
911
export * from './ws.provider';

src/providers/user.provider.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Provider } from '@nestjs/common';
2+
import { Client, ClientUser } from 'discord.js';
3+
4+
export const UserProvider: Provider<ClientUser> = {
5+
provide: ClientUser,
6+
useFactory: (client: Client) => client.user,
7+
inject: [Client]
8+
};

0 commit comments

Comments
 (0)