![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
recime-bot-extension
Advanced tools
Readme
The purpose of this module is to dynamically create rich UI elements for your bot inside smartloop
platform.
Copy and paste the following code inside script block to render a text element:
import Ext from "recime-bot-extension";
const __ = Ext.default;
exports.handler = (context, done) => {
// context.args
done(__.text("Hello world"));
};
Button template is supported in Facebook Messenger and Viber. It is possible to create a button template in the following way:
import Ext from "recime-bot-extension";
const __ = Ext.default;
exports.handler = (context, done) => {
// context.args
done(__.buttonTemplate("Your Summary", [
__.postbackButton('Button1', 'about'),
__.urlButton('Button2', "https://recime.io")
]));
};
Viber on the other hand supports row and column and additional properties to customize the look and feel of a button template:
//script block
import Ext from 'recime-bot-extension';
const __ = Ext.default;
exports.handler = (context, done) => {
done(__.buttonTemplate('Text', [
__.postbackButton('button1', 'about', {
bgColor : '#e30c2e',
fgColor : '#fff',
row : 0,
column : 0
}),
__.postbackButton('Button2', 'start', {
bgColor : '#76c0d6',
fgColor : '#fff',
row : 0,
column : 1
})
]));
};
The following properties are supported for a Viber button:
Property | Description |
---|---|
bgColor | Background color |
fgColor | Foreground color |
row | Number of columns per carousel content block. (0 - 5) |
column | Number of rows per carousel content block. (0 - 6) |
imageUrl | Link (https://) |
textSize | Font size. (regular, large, small) |
align | Text Alignment (left, center, right) |
Use this extension to dynamically construct "Generic Template" or "Carousel". An example of a generic template that is constructed dynamically from an API result is shown below:
import Ext from "recime-bot-extension";
const __ = Ext.default;
exports.handler = (context, done) => {
const result = {
forecast : [
{
id : 1,
day : new Date().toISOString(),
temp: '60F',
icon: 'https://dashboard.smartloop.ai/assets/logo1.png'
},
{
id : 2,
day : new Date().toISOString(),
temp: '40F',
icon: 'https://dashboard.smartloop.ai/assets/logo1.png'
}
]
}
const t = __.genericTemplate(result.forecast.map(r => {
return __.genericItem(r.day, r.temp, r.icon,
null,[
__.postbackButton('Detail', `id-${r.id}`)
]);
}));
done(t);
};
replyButton
to capture user Input */Copyright © 2018 Recime Inc. All rights reserved.
FAQs
Recime bot extension
The npm package recime-bot-extension receives a total of 0 weekly downloads. As such, recime-bot-extension popularity was classified as not popular.
We found that recime-bot-extension demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.