Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect attachement to conversation #386

Merged
merged 2 commits into from
May 31, 2024
Merged

connect attachement to conversation #386

merged 2 commits into from
May 31, 2024

Conversation

OdapX
Copy link
Collaborator

@OdapX OdapX commented May 16, 2024

No description provided.

Copy link

vercel bot commented May 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 11:06am
landing-page ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 11:06am

if (message) {
const existingContact = await prisma.contact.findUnique({
where: {
id: `${message.from.id}`,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here contact.id is set to telegram from'id
We should not mix external unknown id types with our own
That's why there is an externalId column

if (!existingContact) {
await prisma.contact.create({
data: {
id: `${message.from.id}`,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use telegram id here

@@ -333,11 +287,11 @@ const webhook = async (req: AppNextApiRequest, res: NextApiResponse) => {
const chatResponse = await handleChatMessage({
agent,
channel: ConversationChannel.telegram,
channelExternalId: `${chatId}`,
channelExternalId: `${externalId}${chatId}`,
conversationId: `${chatId}`,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conversationId should not be an unknown external ID type

@@ -333,11 +287,11 @@ const webhook = async (req: AppNextApiRequest, res: NextApiResponse) => {
const chatResponse = await handleChatMessage({
agent,
channel: ConversationChannel.telegram,
channelExternalId: `${chatId}`,
channelExternalId: `${externalId}${chatId}`,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this combo needed? chatId not enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants