getI18n

get related i18n dictionary.

getI18n
Parameters
i18n (object) object
Name Description
i18n.props Array<string> variables used in string

t

Light weight i18n support.

define strings in an object const i18n = { 'en': { hello: 'Hello {{name}}', }, 'zh_TW': { hello: '你好,{{name}}', }, props: ['name'], }

t('hello', { i18n, hello: 'world' }) // Hello World

export SAIHUBOT=zh_TW t('hello', { i18n, hello: 'world' })

// 你好,world

t
Parameters
str (string) the string id
args (any)

openTab

Open url in browser.

openTab(url: String)
Parameters
url (String)

addonExec

Run local command via execa. https://www.npmjs.com/package/execa

addonExec

Open link in browser.

addonOpenLink

addonFetch

Expose web equivalent fetch API.

addonFetch

addonSearch

Render search response message.

addonSearch
Parameters
action (String) action word
term (String) search term
url (String) real search url
engine (String) search engine

getConfig

get SAIHUBOT_[env] environment variable and return as string or array.

getConfig
Parameters
env (any)
defaultValue (any)