Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Feat/telegram integration #220

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

bpedersen
Copy link

ISSUE #4342

Context

Added ability to add Telegram bot to create conversation based on the chat that it is an admin of.

Testing:

  • Click on +Add for telegram
  • Create a telegram bot and add the bot token
  • Click next
  • You will need to change the status of the bot in a chat to admin. (If already admin, you will need to remove admin and re-add as admin, unfortunately bots cannot query chats they are admin of)
  • Refresh the page and the available chats will be listed
  • Select chat and click next
  • Set name, channel, brand and save

Conversations will now be tracked within erxes!!

/claim #4342

if (message.from?.is_bot) return;

// Ignore private messages
if (message.chat.type === 'private') return;
Copy link
Member

@soyombo-baterdene soyombo-baterdene Jul 26, 2023

Choose a reason for hiding this comment

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

@bpedersen why ignore private messages? We need to connect with customers that have sent pm to bots

Copy link
Author

Choose a reason for hiding this comment

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

The way that it is configured now is that the integration is on the per chatroom level. So when setting up the integration you have to specify which channel it is creating a conversation in. Would we like to make a integration per bot instead?

return;
}

const chat = await Chats.findOne({ telegramId: message.chat.id });
Copy link
Member

Choose a reason for hiding this comment

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

@bpedersen chat could be null, if chat is null error will be thrown in next line

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

Successfully merging this pull request may close these issues.

2 participants