Skip to content

Commit

Permalink
Merge pull request #56 from TogetherCrew/55-discord-hivemind-adapter
Browse files Browse the repository at this point in the history
feat: add queue and event for the DiscordHivemindAdapter
  • Loading branch information
Behzad-rabiei authored Oct 15, 2024
2 parents 6fe0fd8 + 3eef6ce commit a3ac53f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@togethercrew.dev/tc-messagebroker",
"version": "0.0.46",
"version": "0.0.47",
"description": "a service that include common things that need in every microservies ",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -28,4 +28,4 @@
"files": [
"dist/**/*"
]
}
}
24 changes: 14 additions & 10 deletions src/enums/event.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum AnalyzerEvent {

const ServerEvent = {
UPDATE_GUILD: 'UPDATE_GUILD',
ANNOUNCEMENT_SAFETY_MESSAGE: 'ANNOUNCEMENT_SAFETY_MESSAGE'
ANNOUNCEMENT_SAFETY_MESSAGE: 'ANNOUNCEMENT_SAFETY_MESSAGE',
};

const DiscordBotEvent = {
Expand All @@ -29,7 +29,12 @@ const DiscordBotEvent = {
},
FOLLOWUP_MESSAGE: {
CREATE: 'FOLLOWUP_CREATE',
}
},
};

const DiscordHivemindAdapterEvent = {
QUESTION_COMMAND_RECIVED: 'QUESTION_COMMAND_RECEIVED',
QUESTION_RESPONSE_RECIVED: 'QUESTION_RESPONSE_RECEIVED',
};

const DiscordAnalyzerEvent = {
Expand All @@ -38,23 +43,22 @@ const DiscordAnalyzerEvent = {

const TwitterBotEvent = {
EXTRACT: {
TWEETS: "EXTRACT_TWEETS",
LIKES: "EXTRACT_LIKES",
PROFILES: "EXTRACT_PROFILES"
TWEETS: 'EXTRACT_TWEETS',
LIKES: 'EXTRACT_LIKES',
PROFILES: 'EXTRACT_PROFILES',
},
SEND_MESSAGE: 'SEND_MESSAGE',
}
};

const HivemindEvent = {
INTERACTION_CREATED: 'INTERACTION_CREATED',
GUILD_MESSAGES_UPDATED: 'GUILD_MESSAGES_UPDATED',
}
QUESTION_RECIVED: 'QUESTION_RECEIVED',
};

export const Event = {
[Queue.SERVER_API]: ServerEvent,
[Queue.DISCORD_BOT]: DiscordBotEvent,
[Queue.DISCORD_ANALYZER]: DiscordAnalyzerEvent,

[Queue.DISCORD_HIVEMIND_ADAPTER]: DiscordHivemindAdapterEvent,
[Queue.TWITTER_BOT]: TwitterBotEvent,
[Queue.HIVEMIND]: HivemindEvent,
} as const;
4 changes: 1 addition & 3 deletions src/enums/queue.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ export enum Queue {
SERVER_API = 'SERVER_API',
DISCORD_BOT = 'DISCORD_BOT',
DISCORD_ANALYZER = 'DISCORD_ANALYZER',

// TWITTER
DISCORD_HIVEMIND_ADAPTER = 'DISCORD_HIVEMIND_ADAPTER',
TWITTER_BOT = 'TWITTER_BOT',

HIVEMIND = 'HIVEMIND',
}

0 comments on commit a3ac53f

Please sign in to comment.