I have question about Telegram bot.
I want keyboard and inline keyboard, Can I enable both of the features at the same time ?
According to Telegram documentation, it's currently impossible to pass two or more objects for reply_markup at the same time. reply_markup only accepts one of these objects at the same time:
InlineKeyboardMarkup
ReplyKeyboardMarkup
ReplyKeyboardRemove
ForceReply
And of course you cannot combine two or more objects together. If you wanna show keyboard and have inline keyboard too, you can show the keyboard in a message and after that send another message with inline keyboard.
Cheers,
Related
Telegram has in class telegram.ReplyKeyboardMarkup parameter one_time_keyboard (bool, optional) – Requests clients to hide the keyboard as soon as it’s been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to False.
But Viber always hides keyboards. How to make the keyboard available to the user?
Now I have one idea to draw a keyboard along with each message.
I would like to implement Custom Entry (Xamarin.forms) when the user focus the Entry, device will show Emoji keyboard.
Short answer
Unfortunately it is impossible without creating your own keyboard, due to Android and iOS platform limitations.
Long answer
Default behaviour on iOS is to show the emoji keyboard icon in the bottom of the keyboard. So it is only one tap away from the user:
Default behaviour on Android is seems to be slightly different and the emoji keyboard is hidden by default:
Luckily, it is very easy to place the emoji keyboard icon by setting the InputType to Android.Text.InputTypes.TextVariationShortMessage | Android.Text.InputTypes.ClassText:
If you are still looking to show the emoji keyboard by default, I am afraid you will have to implement your own keyboard view. Depend on your needs you could add few emojis as buttons and etc.
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/entry#customizing-the-keyboard
Customizing the Keyboard
The keyboard that's presented when users interact with an Entry can be set programmatically via the Keyboard property, to one of the following properties from the Keyboard class:
Chat – used for texting and places where emoji are useful.
Default – the default keyboard.
Email – used when entering email addresses.
Numeric – used when entering numbers.
Plain – used when entering text, without any KeyboardFlags specified.
Telephone – used when entering telephone numbers.
Text – used when entering text.
Url – used for entering file paths & web addresses.
This can be accomplished in XAML as follows:
<Entry Keyboard="Chat" />
The equivalent C# code is:
var entry = new Entry { Keyboard = Keyboard.Chat };
I want to create a message with telegram api that users could share(forward) it along its inline keyboard buttons.
I know with telegram api you can create a message that contains inline keyboard by adding inline_keyboard array in replay_markup of a message but when I forward this message inside telegram just the text part of the message forwards and buttons wont.
In brief I want to know is it possible to create a message with telegram api that when someone forwards this message inline keyboard of that message forwards too.
InlineKeyboardButton with "url" or "login_url" parameter can be forwarded.
Note: if there is another button in keyboard without "url" or "login_url" parameter whole keyboard woudn't be shown
You can't attach inline keyboard in the forwarded message, but you can add a “Share” button, and use switch_inline_query in inline keyboard.
For instance: Users can use #Sean_Bot TeleBot to send a photo with inline buttons, if they want to keep inline buttons, they should click “Share” button instead of directly forward.
I'm going to make vote-bot based on Schulze-method, so I need to show individual buttons for every user. Is it possible?
No possible to make different inline keyboard for each user in same chat at this time.
But I think you can use a button with url parameter contain https://t.me/Bot?start=vote_uniqueId, and when user click it, your bot will receive /start vote_uniqueId. And then you can give they different keyboard to vote now. :)
One of our application is implemented in flex and adobe air. We want to have the user press combination of keys, say 'ABC', and have the keyboard return a different character, 'FOG', to whatever app is in focus. This should work even if app has no focus.
Will it possible in Adobe Air/Flex? If yes, provide me some examples?
Thanks in advance
That won't work. Flash/AIR can only listen to keyboard events when it has focus, so as a background application it won't be able to manipulate the key codes that come directly from the driver.
Even if it was possible to notice when a key was pressed, it is not possible to change that value. So if you want to change which key codes are returned, you should rather write a driver for it, or try to get access to it with a lower level approach (C & WinAPI maybe).