telegram bot prefill text for user to edit - bots

Telegram bot sends me a message with a text snippet, which I want to edit, and send back to the bot for further processing.
Copy and paste takes time. Typing message anew takes time.
Ideally I'd like to press an inline button "Edit" on the bot's message and get the message text appear in my reply input box for editing.(A message id attached to my reply somehow would be a plus).
I tried to use deep linking with parameters other than /start*, but that doesn't seem to work.
Can I use bot API (or any other telegram API) to have text ready for editing in my input box?

It's impossible in official apps yet. Your question is about working with drafts - there are no methods in both API to create them or clear.
Nevertheless, you could fork any official app stored on GiHub and implement what you need if you would prefer a hard way, but compared to that copy/past solution seems much more easier, isn't it?
UPD
I can offer to you a new idea how to solve your problem - hope it will be helpful.
This is about switch_inline_query_current_chat field of InlineKeyboardButton. Just attach an inline button to messages you need to edit. Set a text for this field gotten from recieved message and after pressing you will get this text to your input area. All seems good, but you will take bot's username before the text also.

Related

Enter for message telegram bot

Currently, I am developing telegram bot to send message to all member in group chat.
My difficulty right now I cannot make a message with enter.
I already tried adding \n however it wont worked.
this is what I want for example.
message:
Good morning,
Have good day.
when the message need to have enter it cannot send with enter. the result will be like this.
Good morning,/n/n Have good day.
does anyone know how telegram read enter which can be used in python code.
Ok, to send multiline messages, you can use the multiline strings like this:
bot.send_message('chat-id', """
Good morning,
Have good day.
""")
and enable the markup also, so that it dose not interfere the empty lines.

Show upper-part of adaptive card

I have this very long "form" using adaptive card. Using CardFactory, the bot framework, based on my understanding, can render the card and my bot can display it for my user to fill in the necessary details.
The end of my form (in which I'll use instead of the word adaptive card), has a submit button for user to click whenever all fields are filled in. And while everything works the way I want it to be, its not really user friendly in a sense that what user sees after showing the form is the bottom part of it. User has to scroll for a bit to go up and see the first part of the form.
My question is: Is there anyway I could help user experience by showing the upper-part/top most part of the form? Is that possible in bot framework?
Like if the bot sends successive messages, does the framework allows to show the first messages first, before the last part. THANK YOU!
PS. I use NodeJS for my bot framework, read the documentation but can't find one that dwells deeply about adaptive cards.
Please see images below:
How do I make the first framework to show the first image before the end part which is in the second image.
Have you looked at the "ShowCard" action? It basically lets you collapse part of your card, and only open it when a user clicks on a button. That way you could possibly group your card into sections and show each one at a time. See here for more.
Another option in future is the new ToggleVisibility action in AdaptiveCards 1.2, but it's only if your client supports 1.2. (e.g. it's only available in Developer Preview for Teams right now (so very likely coming in future, but not available at the moment))

How can I configure QnAMaker tool to modify liststyle button in Skype?

I have made a bot using QnA Maker and Node JS which is running on Skype.
When the user inputs a word which has got multiple matches in FAQ link or document uploaded in QnA Maker, it shows button of choice using QnAMakerTool module from Node. My question is when the multiple matches has same initial words then because of the size of the choice button in Skype the half of the texts get hide. For example, I have three matches like
Whom should I contact for parking?
Whom should I contact for canteen?
Whom should I contact for Stationery?
It shows in Skype as
Whom should I contact for...
Whom should I contact for...
Whom should I contact for...
If the option text is too long then few parts get hidden. What can I do for this?
First of all, there is a limitation on the max characters in Skype, so that's something you will have to live with. However, you can implement some custom logic to change the text being shown.
That current logic that you are seeing is on the QnAMakerTools file.
The way to go here is probably providing your own QnAMakerTools implementation (it needs to follow this interface).
The QnAMakerDialog receives an IQnAMakerOptions parameter. One of the properties of that interface is feedbackLib which basically is the QnAMakerTools instance that the dialog will later use to disambiguate the question as you can see here.

Discord bot can't show emote "sometimes"

As a french Gwent player, I built a discord bot (using node.js and discord.js) to show the infos of a card when you name it. It uses some custom emotes to show some part of it.
It worked well for a few weeks, but recently some cards don't show the emotes when called.
I have no clue about what could be wrong. The emotes work if you use it yourself on the channel. Some cards show the emotes, others don't, even if they use the same emotes. And it's always all emotes or none for each card.
I checked different cards from my database : with or without emotes, I can't get any specific element which can explain why some cards can have emotes and why some cannot.
Is there something to know here that can explain this situation ?
Although this a late answer and you may have found an answer to the question but I'm going to post an answer anyways for others.
First in the chat you have to type:
\:custom_emote_here:
so in your case, you want it to show
and the name of it was :number5:, you would type :number5:.
You would get something like this:
(of course, it would say :number5: and the start and the numbers would be different)
You can copy and paste that into your code.
For example:
message.channel.send("<:super_magical:366208548914331659>")
would show this:
Hope this helps!
javascriptdiscorddiscord.jsemote
The developers of Discord have recently changed the way bots work with regards to custom emoji.
Before May 16th, bots could use any custom emoji from any server provided they are used inside rich embeds, as shown in your screenshot.
After that date, bots can use custom emoji from shared servers, but do not have to limit it to rich embeds only.
If you have the bot join all the servers that these custom emoji are being hosted on then it will be able to start using the emotes again.
I know that this question was asked quite a whiles ago but I thought I'd offer a solution I found after recently running into this issue myself for anyone else also facing this problem.
Normally, when you send an emoji in a message or embed via the <:name:id> format, Discord will convert it to a custom emoji. However, there are two cases where it represents all custom emojis in a message in the :name: format as shown in your example.
If one of the custom emojis you are trying to send are no longer active in the server (i.e. you have removed it from the server).
If you are trying to send an animated emoji via the <:name:id> format.
If either of the above two conditions are met, it seems like Discord defaults to converting all emojis in the message to :name: rather than the actual custom emoji.
I fixed it for myself by making sure that all of the emojis currently exist in the server emoji list before sending them. For animated emoji, you should send it via the <:a:name:id> format instead.

How to attach a file using https://mail.google.com/mail/

I know you can send email using https://mail.google.com/mail/?view=cm&tf=0&fs=1&to=email#address.com&body=text
However, my body is normally over the size limit (about 800 chars) it can handle. How can I specify the body otherwise? Is there a way to attach a file?
Also, can someone explain the key words used in this approach? What does tf=0 mean? and fs=1?
Also, after the email is sent out, it always pops up a dialog with "The webpage you are viewing is trying to close the window. Do you want to close this Window?" and I had to click yes or no. How can I get rid of this dialog?

Resources