Skip to content

Commit

Permalink
chore: updated APIs to fetch poll ID
Browse files Browse the repository at this point in the history
  • Loading branch information
janhvipatil committed Mar 22, 2024
1 parent 70ddeee commit d58add2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions raven/api/chat_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def get_messages(channel_id: str, limit: int = 20, base_message: str | None = No
message.replied_message_details,
message.content,
message.is_edited,
message.poll_id
)
.where(message.channel_id == channel_id)
.orderby(message.creation, order=Order.desc)
Expand Down Expand Up @@ -149,6 +150,7 @@ def fetch_older_messages(
message.replied_message_details,
message.content,
message.is_edited,
message.poll_id
)
.where(message.channel_id == channel_id)
.where(
Expand Down Expand Up @@ -254,6 +256,7 @@ def fetch_newer_messages(
message.replied_message_details,
message.content,
message.is_edited,
message.poll_id
)
.where(message.channel_id == channel_id)
.where(condition)
Expand Down
2 changes: 2 additions & 0 deletions raven/raven_messaging/doctype/raven_message/raven_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def on_update(self):
"text": self.text,
"content": self.content,
"file": self.file,
"poll_id": self.poll_id,
"message_type": self.message_type,
"is_edited": 1 if self.is_edited else 0,
"is_reply": self.is_reply,
Expand Down Expand Up @@ -230,6 +231,7 @@ def on_update(self):
"message_type": self.message_type,
"is_edited": 1 if self.is_edited else 0,
"is_reply": self.is_reply,
"poll_id": self.poll_id,
"creation": self.creation,
"owner": self.owner,
"modified_by": self.modified_by,
Expand Down
5 changes: 3 additions & 2 deletions types/Messaging/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface BaseMessage {
channel_id: string,
creation: string,
modified: string,
message_type: 'Text' | 'File' | 'Image',
message_type: 'Text' | 'File' | 'Image' | 'Poll',
message_reactions?: string | null,
is_continuation: 1 | 0
is_reply: 1 | 0
Expand All @@ -16,7 +16,8 @@ export interface BaseMessage {
link_document?: string
is_edited: 1 | 0
/** JSON as string */
replied_message_details?: string
replied_message_details?: string,
poll_id?: string
}

export interface FileMessage extends BaseMessage {
Expand Down

0 comments on commit d58add2

Please sign in to comment.