Provide command with value in response as a link by Telegram Bot - hyperlink

When a user sends a command e.g. /new_items to the bot then it replies back with newest 5 items and at the end shows a text as /new-items 5 for paging (which if send to bot will result in sending back next 5 items). When /new-items 5 is shown to user then only /new-items is shown as link i.e. without 5. When user clicks on it then it is send to bot I want to make /new-items 5 as a link so that when user clicks on it then bot receives /new-items 5 and understands that it has to return next 5 results from starting from 6 to 10.

Simply use custom keyboard for this. For python, look at MusicBot example from aiotg library.

Related

Call button in Power Apps to make PSTN calls via Teams client on mobile

I am building a mobile Power App with an address book page. I have created a call button on this page to make phone calls using Microsoft Teams.
Here is the code I'm using: Launch("https://teams.microsoft.com/l/call/0/0?users=4:MobileNumber")
When I click the button it redirects me to Teams to make the call. The problem I'm facing is the number displayed is incorrect.
For example, when I try and call the following number:
Mobile Number
This is what it shows on Teams:
Shows Wrong Number
I have tried typing in the number manually, for example: Launch("https://teams.microsoft.com/l/call/0/0?users=4:02073307500") which works, see below:
Correct Number
The only problem is the number changes based on the gallery I'm using which pulls the data from: Office365Outlook.ContactGetItemsV2("Contacts").value
So when I use MobileNumber value, which is a field that displays the phone number, it doesn't match the number when I click the call button.
I am stuck, please help!
Thanks,
Liam

Telegram bug on iOS bot sending multiple times same message

I think I've found a Telegram bug on the iOS app that causes the bot to send multiple times the same message. The steps to reproduce the problem are:
click on an inline button, type callback
immediately lock the phone screen, before the bot answers
wait a few moments and then unlock the screen
It will be noticed at this point that the bot starts sending the same message numerous times. It is not easy to reproduce, it is important to lock the screen when the bot has not yet answered, so it is easier with bots that take a few moments to respond. Also, in the answer the bot has to send a message (not editing one that already exist).
I use Microsoft Bot Framework to develop the bot, however all the bots give me the same problem, both mine and others developed with other technologies different from mine. For example, I was able to reproduce it on #BotFather too. Sometimes it enters in a loop, and to stop it you have to send any message to the bot.
I use an iPhone 5, iOS version 12.1.2, Telegram version 5.2. I also tried it on an iPhone 8, but not with other versions of Telegram.
I also happen to receive more than 20 identical messages.
I've already contacted Bot Support on Telegram but no one answers me. Is there anyone who experienced the same problem?
On iOS and macOS, when I click on an inline button and switch the client computer (macbook) off (sleep mode) and turn it on my bot receives the last message sent by the user. Each time message_id is the same.
I solve it the following way: when my script sends a request to the Telegram server it receives a response. That response contains a message_id field and I save it.
Any next message must have another message_id. I just compare that number with the stored number and only if the number is other than saved I run the rest part of my script.
You can try my test bot and watch results in google table.
#ios_bug_bot (https://t.me/ios_bug_bot)
https://docs.google.com/spreadsheets/d/1VTx-O1w_-ka1RzGfaVLVBDu0CQxk16QeJTeFYOE4yvo/edit?usp=sharing
The bot source code is here
https://github.com/avtomatron/telegram_bot/blob/master/google_script_bot

Can we send editable forms in a group chat via xmpp ios?

I need to implement groupChat and exchange different format of data between chat users for which I will be using xmpp alongwith swift technology for the iOS client end . The app requires exchange of editable form with 8 - 10 data fields between group chat users.
For example :- If User-A starts by sending an empty form, now every user will be able to see the form and suppose User-B edits/fill the form, now the updated form will be shown to every user.
My simple question is if it is possible using xmpp and swift . If yes then should i stick to the technology i have mentioned or i have to change it. Thank you.

IOS: How to verify user's phone number using codes

i am working on an app in which i take a field of mobile number of user after entering mobile number there is a option for verify phone number.
but i don't know the functionality of how to verify a user's phone number within the app using codes.I search for similar type of questions but didn't get the exact solutions.
i am sending a screenshot of my app where i want to put that functionality.
i didn't apply any codes for this
please help
You need a backend that can generate and save codes for each phone number and also send a text message with those codes. So the flow is as follows:
User enters their phone number in the app and presses the "Verify Number" button.
You send a request to your backend with the number provided. In the app, you also displays a text field for user to enter the generated code and a new button like "Check code".
The backend generates a new code (just a random one), stores it to the database (like ID,PhoneNumber,GeneratedCode,DateOfGeneration) and sends a text message with the code to the phone number specified.
When the user receives the message he or she enters the code to the checking input field and presses the "Check" button.
The mobile app sends another request to the backend with the phone number entered earlier and the code entered by the user now.
The backend looks to the database for the "Phone number" - "Code" pair and responds with failure (the code is incorrect, try again) or success (the phone is verified).
Unfortunately, there's no way to access text messages received by user from within an app on iOS devices (unlike Android). The proof link was already provided. So the user has to manually enter the verification code from the message.
Ok I tell the information how was I already did my project in before
Step-1
when user press the Verify Number button
initially I check the phone number is valid or not(means phone number count/length).
second I generate the random number on progrmatically like NSUInteger r = arc4random_uniform(16);
Step-2
send the random number to server along with the vaild phone number , the server send the random number to the particular mobile number using SMTP Server.
Step-3
in your hand you have the random number , so open the UIAlertview for user type the valid random number , if user typed the vaild number show the Next Screen else show the Alert.
To verify any mobile number you can use third party api's which are available for mobile as well as backend server. You can use Twilio Messaging Api. To use this API follow below steps:
Register account on Twilio and get key from account.
Get user's phone number from mobile application.
When user click on the "Verify Number" button, call web-service with the number.
When you'll call the web-service, write a logic to send the random number with the Twilio messaging api to send message to user.
When user get this number through SMS, You can tell user to enter the number and verify it.
Also, there is another api which you can directly integrate into your mobile application. You can find this Sinch Api here.
To verify against your device's phone number, first, you need to get the phone number from your device and then you can compare against. However, after iOS 4, getting phone number of your device is quite impossible. Even if, you do get the device's number using some private api which I am not sure works entirely, there is a huge possibility for Apple to reject your app.
Refer to the following stack overflow discussion-
Programmatically get own phone number in iOS
Just a suggestion: You probably want to look for a work around based on your business goal. For example, rather than checking for device's phone number directly. You can generate a code and send that to the number specified by the user and then enter that code to verify that the user has that device.

How to use NSURLSession and NSURLRequest to fetch users feeds and update in a tableview for a social networking iOS app?

I am creating a social networking app in iOS for a university group and it's supposed to have display user feeds just like Facebook.
I am saving status updates in MySql database on a server. to update status I am using NSURLRequest and NSURLSession to send status data in post variables to the status update web service which uses php to update the database.
Now, I am confused about displaying the feeds. Here is what i want to do.
I want to fetch 30 feeds first and display them in tableview.
After 30 feeds if the user clicks on more, I want to be able to add another 30 and so on. just like Facebook, when you scroll to the bottom it shows more feeds.
I know how to make the first request and display 30 feeds, but I dont know how to do it the second time. Do I need to make another request? Can someone please explain how Facebook and Twitter do it?
Your request needs to ask for a specific page or offset of the feed, and your server should handle this.
For the first feed, you'd ask for page 0. The server gives you items 1 - 30. At the app end, you keep track of the page you last requested. On the next request, you ask for page 1, and the server gives you items 31-60.
Alternatively, you can send the ID of the last item you have. So for the first request, you send nothing - the server gives you items 1-30. On the second request, you say "the last item in my current list is ID 14152" and the server gives you the next 30 items older than that.

Resources