lazybios / lark-ruby-sdk

Ruby SDKs for Lark(飞书) API https://open.feishu.cn/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gem Version

Ruby SDKs for Lark(飞书) API https://open.feishu.cn/

安装

Add this line to your application's Gemfile:

gem 'lark-sdk'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install lark-sdk

require 'lark/sdk'

使用

初始化:

# config/initializers/lark.rb

Lark.configure do |config|
  config.redis = Redis.new(url: 'redis://127.0.0.1:6379/1')
  config.default_app_id = 'xxx'       # 应用 app ID
  config.default_app_secret = 'xxx'   # 应用 app secret
  config.default_isv = true           # 自建应用: false, 应用商店应用: true
  # ...
end

实例化 API:

api = Lark::Api.new(
	app_id: 'xxx',        # default: Lark.config.default_app_id
	app_secret: 'xxx',    # default: Lark.config.default_app_secret
	isv: false/true,      # default: Lark.config.default_app_secret
	tenant_key: 'xxx'     # required while internal app
)

加/解密:

cipher = Lark::Cipher.new(encrypt_key)

# 解密
cipher.decrypt(message)

# 加密
cipher.encrypt(message)

Api 列表

贡献

如果你有好的意见或建议,欢迎给我们提issue或pull request。

License

The MIT License(http://opensource.org/licenses/MIT)

请自由地享受和参与开源

About

Ruby SDKs for Lark(飞书) API https://open.feishu.cn/

License:MIT License


Languages

Language:Ruby 99.5%Language:Shell 0.5%