Skip to content

Instantly share code, notes, and snippets.

@etrex
etrex / ga.js
Created October 19, 2021 18:04
使用 Google Analytics 追蹤聊天機器人上的用戶行為
let headers = {
'User-Agent': 'Ruby'
}
await axios.post('https://www.google-analytics.com/batch', body, { headers });
require "kamiflex"
# 資料表
class Product
attr_accessor :name
attr_accessor :price
attr_accessor :image
attr_accessor :inventory
def initialize(name:, price:, inventory:, image:)
self.name = name
require "kamiflex"
# 資料表
class Product
attr_accessor :name
attr_accessor :price
attr_accessor :image
attr_accessor :inventory
def initialize(name:, price:, inventory:, image:)
self.name = name
require "json"
# 資料表
class Product
attr_accessor :name
attr_accessor :price
attr_accessor :image
attr_accessor :inventory
def initialize(name:, price:, inventory:, image:)
self.name = name
require "json"
# 資料表
class Product
attr_accessor :name
attr_accessor :price
attr_accessor :image
attr_accessor :inventory
def initialize(name:, price:, inventory:, image:)
self.name = name
@etrex
etrex / index.js
Created June 5, 2020 09:17
Another sample code for Scene
const { router, text, messenger } = require('bottender/router');
const {
run,
registerAction,
getAction,
prompt,
} = require('@bottender/proposal-conversation');
async function SayHi(context) {
await context.sendText('Hi!');
@etrex
etrex / index.js
Created June 5, 2020 08:37
Bottender Conversation for Scene
const { router, text, messenger } = require('bottender/router');
const {
run,
registerAction,
getAction,
prompt,
} = require('@bottender/proposal-conversation');
async function SayHi(context) {
await context.sendText('Hi!');
@etrex
etrex / log
Created April 15, 2020 10:24
npm link
/Users/etrex/.../node_module_test/node_modules/bottender -> /Users/etrex/.asdf/installs/nodejs/12.10.0/.npm/lib/node_modules/bottender
@etrex
etrex / log
Created April 15, 2020 08:23
在 bottender 下 npm init
/Users/etrex/.asdf/installs/nodejs/12.10.0/.npm/bin/btd -> /Users/etrex/.asdf/installs/nodejs/12.10.0/.npm/lib/node_modules/bottender/bin/cli.js
/Users/etrex/.asdf/installs/nodejs/12.10.0/.npm/bin/bottender -> /Users/etrex/.asdf/installs/nodejs/12.10.0/.npm/lib/node_modules/bottender/bin/cli.js
/Users/etrex/.asdf/installs/nodejs/12.10.0/.npm/lib/node_modules/bottender -> /Users/etrex/.../bottender/packages/bottender
@etrex
etrex / package.json
Created April 14, 2020 10:29
package.json with bottender
{
...
"dependencies": {
"bottender": "^1.3.5"
}
}