Telegram integration (Sticker attachments)
Hi we like to integrate Telegram, The documented way is pure text to text. But Sticker Attachments etc are the real deal for any integration. Do you think its possible?
Thanks
+1
Please see https://rocket.chat/docs/administrator-guides/integrations/telegram#simple-telegram-bot-
Would you please read what i have written? The Problem is that the solution from rocket.chat/docs is just a text to text way. We need a way to transfer attachments and Stickers
HI there: The following worked for me @Againstreality:
class Script {
process_incoming_request({ request }) {
// COMMENT THE BELOW LINE THE AFTER YOU RUN THE INTEGRATION SUCCESSFULLY
console.log(request.content);
if ('edited_message' in request.content) {
request.content.message = request.content.edited_message;
}
let who = request.content.message.from.username
if(!who) {
who = `${request.content.message.from.first_name} ${request.content.message.from.last_name}`
}
let body = request.content.message.text
if(!body) {
if(request.content.message.sticker.emoji) {
// It's a sticker
body = request.content.message.sticker.emoji
} else {
return {}
}
}
return {
content: {
username: who,
icon_url: '/avatar/' + request.content.message.from.username + '.jpg',
text: body
}
};
}
}
PR made https://github.com/RocketChat/Rocket.Chat.Docs/pull/174/files
you are awsome !! Thx have you found a way to transfer attachments?
@Againstreality if you look at the sample code, I updated it to what I'm using right now.