How to create a three dashes menu on a Telegram bot? - telegram

How could I create a three-dashes menus on a Telegram bot, similarly to what they do to the Jobs bot? It should be similar to this:
How do we call this kind of menu?

You can add your commands which will be displayed on the menu using the Bot father commands.
I followed the below steps:
Open BotFather send command /setcommand
BotFather will ask for the bot you want to set the command
Provide the command name along with the description in "command - description" format
Now open your bot and the command you send will be displayed on the Menu.
Hope this helps.

In java case with this library.
if the commands already was created, so simply in the class that extends TelegramLongPollingBot:
this.execute(new GetMyCommands());
In other case:
Create new List BotCommand
List<> commandsList = new ArrayList();
Adding BotCommand to the list with name and description
commandsList.add(new BotCommand("commandName", "description"));
Create a new SetMyCommands whit the botCommandList and executed
this.execute(new SetMyCommands(commands));
more information about: https://telegram.org/blog/animated-backgrounds#bot-menu

Related

How can I create cutom fields in Phabricator Manipfest programmatically?

How can I use the maniphest.custom-field-definitions for Phabricator from the cli? I know how to create the custom fields using the UI based on the docs, but I am trying to do this using a command line option by passing in the JSON as stdin if possible.
I am aware that I can conduct various operations from the command like like config, auth, api etc etc, but I could not find a pointer on how to work with custom fields from the command line.
You can use the following command to edit the custom field definitions from a shell:
phabricator/bin/config set maniphest.custom-field-definitions "{ your customfield json here}"
Note:
This is the same answer that I provided on phabricator-community.org. Posting it here as well for posterity.

Sabre : how can we add 'title' with passenger name in sabre API

I am using passengerDetailsRQ sabre API to create PNR and save passenger info. But as per my observation they have option to add first-name and last-name while i want to add title as well. So please suggest if anyone have any suggestion
The Tile goes on the first-name field, after that, add a space then the title
Please check the Format Finder reference below, which has all that you need to know on how to add titles, and character limitation.
https://formatfinder.sabre.com/Content/PassengerNameRecordPNR/PassengerNameRecordFields/NameFieldInPNR.aspx?ItemID=face5f8246b6423794920175b4cc2a3c
In order to login, you may use the same credentials used for creating session on web services.

Click element, hold Shift key and click another element in robotframework

I need to be able to click an element on a webpage and hold the Shift key on keyboard and press another element.
Can I implement this behaviour using "Press Key" in Selenium2Library?
You can try to achieve your scenario using AutoItLibrary
First you need to install win32com.client, use below command
pip install pypiwin32
Then use AutoItLibrary command like as per your requirement
Send | {SHIFTDOWN}
For more info visit here
Use using Pyautogui library. This library simulates the User Actions on GUI such as Mouse Control, Keyboards inputs,etc. You can find details at
https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjN1ZbrocrSAhWIFJQKHXbiBGcQFggbMAA&url=https%3A%2F%2Fpyautogui.readthedocs.io%2F&usg=AFQjCNEe5LY5eMdaquVD421_u-mpoFUOYQ&sig2=Lj-e4YldvbLNEvPe4NFHrA
Also U can install this library using pip by following keywords in following docs
http://pyautogui.readthedocs.io/en/latest/install.html

Telegram bots: How do you remove a command with botFather

I am trying to erase all commands from my bot using botFather. I couldn't find docs for this. There is an option to send a new list of commands to the BotFather, however this does not help me as my bot doesn't have any commands as I am working with the custom keyboard.
Any idea how to do this?
Just add a new list of commands with /setcommands.
your old list will be overwritten.
There is no direct functionality like "Delete command". You just have to Overide commands again. It like this. Lets assume you have command set like below
/love - Love is eternal
/partner - return partner
/status - return relationship status
Let say you need to remove command /status from your bot. First you need to go to #BotFather get your list of bots using /mybots select your bot, then select Edit bot next Edit Commands. Now you will prompt to add new set of commands. Then Give command list without the one you need to remove. Like below
love - Love is eternal
partner - return partner
Then BotFather will add new command set in to you new bot. Don't worry if you can't see your new Command set at once. They will add after like 10 mins
As on today, you can send command /empty to delete all the commands in Edit Commands menu.
BotFather just maintains a list of commands you provide.
You can do a new /setcommands with it, but you can't actually alter the functionality of your bot from there.

Anguilla - Get the version and user information

I have created a command button on the Ribbon Toolbar. When I select an component an click on "Display Info" button, an popup should open telling me about the latest version of the Component, Modified date, and the User who last modified it.
I do get the component with the following code:
var item = $models.getItem(selection.getItem(0));
How can I get the other information from here.
Part 2:
When I try to see the JS code in Firebug, I see them in one single line. I am unable to put an break point on the execute function within my code.
Any suggestions on the above points. ?
To deminify the JS, to allow you to add breakpoints, and also to allow you to use a JS console to inspect objects that are available, you can follow the instructions at http://code.google.com/p/tridion-2011-power-tools/wiki/DeactivateJSMinifier.
User information can be retrieved using the information at How to get the user Id of the currently logged user in Tridion?
I find that the only way to find anything with Anguilla is to use a JS Console like Chrome's.
Once you get the current item - like you do now - you can do stuff like:
var version = item.getVersion();
var lastModifiedDate = item.getLastModifiedDate();
var lastEditorId = item.getStaticRevisorId();
getStaticRevisorId() gives you the Tridion URI of the last user to change the item, and you can then load this to retrieve further information from it.

Resources