C
C
carbanak012020-10-10 17:52:51
Node.js
carbanak01, 2020-10-10 17:52:51

How to display emoticon code on Node.JS Telegram Bot Api?

Hello !
I need that when the user sends a smiley, the bot sends its code to me in the terminal.
The problem is that when I send the code, a question mark appears in the terminal (that is, it does not understand what this character is).
Please do not offer any ready-made modules on Node.js, I'm interested in how this is done by handles.
I would be grateful if you tell me how to distinguish the user's sent emoticon from a regular text message =)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
carbanak01, 2020-10-11
@carbanak01

I found the solution before Johnny Lowhunter wrote =)
But thanks for the answer anyway!
Here is the code that helped me convert the smiley to Unicode encoding.

for(let i = 0; string.length > i;i++){
console.log(string.charCodeAt(i).toString(16));
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question