html
This method creates a message in HTML format.
html(code=String, reply_markup=Hash, extra_params=Hash)
html(code=String, reply_markup=Hash, extra_params=Hash)
Platforms
Platform
Supported
Messenger
Telegram
Usage
HTML Only
@reply.html("<b>bold</b>, <strong>bold</strong> <i>italic</i>, <em>italic</em><u>underline</u>, <ins>underline</ins>")
HTML with replies below
@reply.html(
"<b> Here the HTML with some quick_replies </b>",
{
quick_reply: [
{
payload: :option_1,
title: "Option 1!"
},
{
url: "https://twitter.com/kogno_framework",
title: "Follow US!"
}
]
}
)
From .rhtml
template
.rhtml
template code = html_template("main/demo1")
@reply.html(code)
The template "main/demo1" is located in bot/action_templates/main/demo1.rhtml
file.
<% 7.times do %>
<b>Hello</b> <i>World</i>
<% end
Read more about html_template
method here.
Params
Name
Description
code
String
Required.
The HTML code, 4096 characters max. View the full html tags supported by Telegram here.
reply_markup
Hash
Optional. Hash with one element that can be:
:quick_reply
=> inlinekeyboardmarkup
:button
=> replykeyboardmarkup
extra_params
Hash
Optional. Hash with more params, view the full list from Telegram.
Last updated
Was this helpful?