Hyperlink Markdown dynamically in discord - discord

I'm trying to make an embed message where the title of the video is the link. To achieve that I'm using square brackets and parentheses around the objects, but they are being shown as strings in the message. Any ideas on how this could be done?
for (let i in listaResultados){
embed.addField(
`${parseInt(i)+1}: [${listaResultados[i].tituloVideo}](${listaResultados[i].link})`,
listaResultados[i].descricao)
}

Embed field names do not support markdown, including masked links.

I think there are couple solutions you can do.
Utilize the Embed's title and url properties. However, this would limit you to producing only one embed per video, which means only 10 total (at one time) since 10 is the limit per message.
{
"embed": {
"title": "Music Video Title",
"description": "Description goes here",
"url": "https://video-url.com"
}
}
The other way is to do what the other user mentioned - use the description field.
{
"embed": {
"title": "Music Videos List",
"description": "1. [Video 1](https://google.com) \n 2. [Video 2](https://google.com/) \n 3. [Video 3](https://google.com/)"
}
}
You can use this website for quick reference and experimentation of the embed code.

Related

Alexa Skill renders display card in Alexa companion app

How To add an image to this card or how remove it totally?
How to add an image to Alexa Card ?
Form the official documentation(https://developer.amazon.com/docs/custom-skills/include-a-card-in-your-skills-response.html#creating-a-basic-home-card-to-display-text)
A home card can include a single image. In this case, you provide the
title, text, and two URLs (a small version and large version) for the
image to display.
Note that the total number of characters (title, content, and both
URLs combined) for the card cannot exceed 8000. Each URL cannot exceed
2000 characters.
To create a card with an image, include the card property in your JSON
response:
Set the type to Standard. Set the title and text properties to the
text to display. Note that this type of card uses a text property, not
a content property like Simple. Use either "\r\n" or "\n" within the
text to insert line breaks. Include an image object with smallImageUrl
and largeImageUrl properties. Set smallImageUrl and largeImageUrl to
the URLs of a small and large version of the image to display. See
below for details about the image format, size, and hosting
requirements.
{
"version": "1.0",
"response": {
"outputSpeech": {"type":"PlainText","text":"Your Car-Fu car is on the way!"},
"card": {
"type": "Standard",
"title": "Ordering a Car",
"text": "Your ride is on the way to 123 Main Street!\nEstimated cost for this ride: $25",
"image": {
"smallImageUrl": "https://carfu.com/resources/card-images/race-car-small.png",
"largeImageUrl": "https://carfu.com/resources/card-images/race-car-large.png"
}
}
}
}
When using the Java library:
Create a StandardCard object. Call the object's setTitle() and
setText() methods to set the title and content. Create an Image object
and assign the URLs with the object's setSmallImageUrl() and
setLargeImageUrl() methods. Pass the Image object to the StandardCard
object with the setImage() method. Pass the StandardCard object to
either SpeechletResponse.newTellResponse() or
SpeechletResponse.newAskResponse() to get a SpeechletResponse that
includes the card.

Title Case is not working in Angular Schema Form

How do you require title case in a field rendered using Angular Schema Form.
EG. ^([A-Z][^\s]*\s?)+$
Please provide the inputs.
An example for the appropriate pattern definition to be provided in the schema would be:
{
"title": "My string",
"type": "string",
"pattern": "^([A-Z][a-z]*[\\s]*)*$"
}
You may need to add further exceptions but that will cover basic title case.

How do i extract the original date value passed from the user input

Context:
The Watson Conversation bot has a node that gets triggered by three input entities from the user, this works fine, but i want the reply from the bot to be
"Checking if you have a lecture tomorrow. Give me a moment"
then there's a query in the background building up the answer that gets replied later to the user.
the strong word tomorrow is an #sys-date entity, but i want it to reply to the user what he/she said instead of the date, because the bot can check no both weeks months ect, all valid date formats, and the reply would look much better if i could use the original text from the user.
This kind of origin retrieval will be used for other entities aswell when i get it working.
You can use the context variable in the case, and if you want to get specific data, you can use regex to extract the user input:
Example all user input
"date": "<? input.text?>"
or for exactly what the user input, ex: "this week"
"date": "<?#sys-date.literal?>"
Etc..
Use the variable with the .literal, see my complete example:
{
"context": {
"date": "<?#sys-date.literal?>"
},
"output": {
"text": {
"values": [
"Checking if you have a lecture $date. Give me a moment."
],
"selection_policy": "sequential"
}
}
}
Documentation examples
:

Selenium IDE cannot find ID

I recorded a test with Selenium IDE but when I try to run the test I get an error [error] Element id=jsonform-0-elt-businessActor not found
I also noticed this particular field's id is slightly different.. The rest of the fields have this format id=jsonform-0-elt-0.nameOfJsonAttribute
Could there be any reason why the bussinessActor ID is not working and captured differently?
JsonSchema used to render the form:
{
"type":"object",
"id": "001",
"title": "testSchema",
"properties":{
"businessActor": {
"type":"string",
"title": "Name",
"description": "example of a description."
}
}
}
Note: Am using jsonForm to render the form based on json shema. Form id's are generated dynamically by jsonFom. And am also using Angular.js (angular is not playing a role in this aprticular issue, I think)
As #MarkRowlands suggested, it sounds like your page is dynamic.
Try this out as your target...
css=[id^='jsonform'][id$='businessActor']
^= means 'starts with' in css. $= means 'ends with' in css.
Change that selector to match whatever you would like to select.

Use of "creator" property in timetime insert doesn't seem to work

The playground has an example card that includes a "creator" field with the name and an image representing "Google Glass". The JSON used to create this card is
{
"text": "Hello Explorers,\n\nWelcome to Glass!\n\n+Project Glass\n",
"creator": {
"displayName": "Project Glass",
"imageUrls": [
"https://lh3.googleusercontent.com/-quy9Ox8dQJI/T3xUHhub6PI/AAAAAAAAHAQ/YvjqA3Pw1sM/glass_photos.jpg?sz=360"
]
},
"notification": {
"level": "DEFAULT"
}
}
When this is sent to Glass, however, the imageUrl isn't displayed. The documentation at https://developers.google.com/glass/v1/reference/timeline/insert simply says that "creator" is a "nested object", but with no clear indication what this nested object should be. The example seems to indicate that this should be a Contact (see https://developers.google.com/glass/v1/reference/contacts), and the object returned by the insert seems to be of type "mirror#contact", confirming this.
Does the contact used in a creator need to be pre-created via the contacts API call first? Is there something else necessary to get the creator to display or work correctly?
The creator is currently displayed only if the REPLY menu item is provided along with the timeline item.
This seems like a bug, please file it on our issue tracker

Resources