Skip to content

Commit

Permalink
fix: Allow changed messages to be tracked!
Browse files Browse the repository at this point in the history
  • Loading branch information
noahonyejese committed Oct 2, 2024
1 parent 2e95c11 commit aed4103
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/slack/syncs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import * as emoji from 'node-emoji';

export const validateMessageSlackEvent = (event: MessageEvent) => {
if (
!event?.user ||
!(event?.user && event?.message?.user) ||
!event?.channel ||
event?.type !== 'message' ||
typeof event.user !== 'string' ||
typeof event.channel !== 'string' ||
typeof event.text !== 'string'
(typeof event.user !== 'string' &&
typeof event?.message?.user !== 'string') ||
typeof event.channel !== 'string'
) {
console.log(event);
throw createError({
Expand Down
4 changes: 4 additions & 0 deletions types/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export interface ReactionAddedEvent {
export interface MessageEvent {
type: 'message';
channel: string;
message?: {
user: string;
text: string;
};
user: string;
text: string;
ts: string;
Expand Down

0 comments on commit aed4103

Please sign in to comment.