Want to create a Telegram bot to receive feedback from your users in your apps? Here es a little tutorial:
1. Create a Bot using BotFather"by writing "/newbot" inside that channel and then follow the steps.
Important, copy the Token that BotFather will gave you as we will use it later.
2. Create a new channel
3. Add the Bot you have created in step 1 as an admin in the new channel.
4. Now let's get the Channel ID (we will use it later).
Go to this website replacing "\token\" with the Token you got in step 1.
"
api.telegram.org/bot\token\/getUpdates"
You will get a JSON object , and your channelID will be the ID inside the Chat object.
If for any reason your chats are empty, just go to your channel and send any message and open again the previous URL.
5. It's time to go to Xcode and make our request this way.
- "chat_id" is the ID that you found in step 4 plus you have to add "-100" to it. So will be: "-100\(ChannelID)".
- "text" is the message you want to send.
- "parse_mode" is the way we want to format the text, we are using "MarkdownV2" format but it can be "HTML".
And that would be all, you can just call your TelegramManager with the message you want.
Note: You can do the URLRequest as you prefer, this is just an example of how to do it. Probably you have your own NetworkLayer.