它是一个允许您通过python操作liff(line frontend framework)的包。
liffp的Python项目详细描述
liffpy
它是一个允许您通过python操作liff(line frontend framework)的包。
小心
■□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□
此分支用于Alpha Version
。
这个包很少或没有测试
□■□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□
如何使用
示例
# -*- coding:utf-8 -*-fromliffpyimport(LineFrontendFrameworkasLIFF,ErrorResponse)defmain():liff_api=LIFF("YOUR_CHANNEL_ACCESS_TOKEN")try:# If you want to add LIFF appliff_id=liff_api.add(view_type="compact",view_url="https://{YOUR LIFF-SITE}")# 400 Error or 401 Errortry:# If you want to update LIFF appliff_api.update(liff_id,view_type="full",view_url="https://{YOUR LIFF-SITE}")exceptErrorResponseaserr:# 401 Error or 404 Errorprint(err.message)returnexceptErrorResponseaserr:# 401 Error or 404 Errorprint(err.message)returntry:# If you want to get all LIFF appsapps_info=liff_api.get()forapp_infoinapps_info:try:# If you want to delete LIFF appliff_api.delete(app_info["liffId"])exceptErrorResponseaserr:# 401 Error or 404 Errorprint(err.message)returnexceptErrorResponseaserr:# 401 Error or 404 Errorprint(err.message)returnif__name__=='__main__':main()
API
线前端框架
__init__(self, channel_access_token)
创建新的linefrontendframework实例。
liff_api=add(view_type="compact",view_url="https://{YOUR LIFF-SITE}")
add(self, view_type, view_url)
向liff添加应用程序。一个频道最多可添加30个liff应用程序。
liff_id=LineFrontendFramework('YOUR_CHANNEL_ACCESS_TOKEN')
视图类型
name | mean |
---|---|
^{ | 50% of the screen height of the device |
^{ | 80% of the screen height of the device. |
^{ | 100% of the screen height of the device. |
在https://developers.line.me/ja/reference/liff/中添加liff app
update(self, liff_id, view_type, view_url)
更新LIFF应用程序设置
liff_api.update(liff_id,view_type="full",view_url="https://{YOUR LIFF-SITE}")
视图类型
name | mean |
---|---|
^{ | 50% of the screen height of the device |
^{ | 80% of the screen height of the device. |
^{ | 100% of the screen height of the device. |
在https://developers.line.me/ja/reference/liff/中“更新liff应用程序”
get(self)
获取有关在频道中注册的所有LIFF应用程序的信息
liff_api.get()
在https://developers.line.me/ja/reference/liff/中“获取所有liff应用程序”
delete(self, liff_id)
删除liff应用程序。
liff_api.delete(liff_id)
在https://developers.line.me/ja/reference/liff/中“删除liff app”