-
Notifications
You must be signed in to change notification settings - Fork 59
Upgrade from v1 to v2
You can set the bot to omit some fields when generating image captions.
Usage:
Set CAPTION_IGNORE
in environment variables, e.g.: CAPTION_IGNORE=bookmarked
Default is none.
Set IS_PUBLIC=true
to share your bot with everyone, default to false.
See Nazurin Extension.
To support Pixiv ugoira GIF preview (sent as MP4) in Telegram, you should have ffmpeg installed.
For more information, refer to https://ffmpeg.org/, make sure libx264 encoder is installed.
On Heroku, add a buildpack to your application:
heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
You can now deploy Nazurin with docker-compose using docker-compose up -d --build
.
-
Add
ALLOW_ID
to replaceADMIN_ID
Set IDs of users with whom you want to share, separated by commas.
e.g.:
ALLOW_ID=12345,23456,34567
Default is none.
-
Add
ADMIN_USERNAME
to replaceALLOW_USERNAME
Set usernames of users with whom you want to share, without
@
, separated by commas.e.g.:
ALLOW_USERNAME=user1,user2,user3
Default is none.
-
ALLOW_GROUP
is renamed toGROUP_ID
Set IDs of groups in which all members have access to this bot, separated by commas.
e.g.:
ALLOW_GROUP=-12345,-23456
-
ADMIN_ID
You still need
ADMIN_ID
in order to receive error reports and have access to some restricted commands. -
User IDs & usernames both works now
While v1 supports either user ID or username, you may use both in v2.
-
Configurable option
STORAGE
is now a string seperated by commas(,
).e.g.:
# v1 STORAGE = ['Mega', 'GoogleDrive'] # v2 STORAGE = Mega,GoogleDrive
-
Local storage is now an independent storage
To use local storage, append
Local
toSTORAGE
, e.g.:STORAGE=Local,Mega
Instead of using
TEMP_DIR
, local storage now shareSTORAGE_DIR
configuration with remote storage. -
Telegram album channel is now a type of storage
Besides setting
ALBUM_ID
, appendTelegram
toSTORAGE
, e.g.:ALBUM_ID=-100123456 STORAGE=Telegram,Mega
-
Local storage destination changed
Local data including collection (
STORAGE_DIR
) and temporary files (TEMP_DIR
) are moved todata
folder at application root.Please create a folder named
data
in the main folder, and moveSTORAGE_DIR
(Default isPicutres
),TEMP_DIR
(Default istemp
) into the folder.
-
Local storage destination changed
Local database files are moved to
data
folder at application root.Please create a folder named
data
in the main folder, and move database files likenazurin.json
andpixiv.json
into the folder.
可设置在生成图片说明时需要忽略的项目。
用法:
在环境变量中设置 CAPTION_IGNORE
,如: CAPTION_IGNORE=bookmarked
默认为空。
通过设置 IS_PUBLIC=true
可与所有人共享,默认为 false。
为了支持 Pixiv 动图(在 Telegram 中以 MP4 格式发送),需要安装 ffmpeg。
更多信息参见 https://ffmpeg.org/,需要安装 libx264 编码器。
如在 Heroku 上使用,需要添加 Buildpack:
heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
现可使用 docker-compose up -d --build
进行部署。
-
添加
ALLOW_ID
替代原有的ADMIN_ID
设置希望与其共享的用户 ID,以逗号分隔。
如:
ALLOW_ID=12345,23456,34567
默认为空。
-
添加
ALLOW_USERNAME
替代原有的ADMIN_USERNAME
设置希望与其共享的用户名,不含
@
,以逗号分隔。如:
ALLOW_USERNAME=user1,user2,user3
默认为空。
-
ALLOW_GROUP
已更名为GROUP_ID
设置一些群组 ID,这些群组内的所有成员都可使用此 Bot,以逗号分隔。
如:
ALLOW_GROUP=-12345,-23456
-
ADMIN_ID
您仍然需要设置
ADMIN_ID
以便接收错误反馈以及使用特权命令。 -
同时支持用户 ID 和用户名
v1 只支持用户 ID 和用户名中其一,v2 同时支持两者。
-
配置项
STORAGE
已更改为以逗号分隔的字符串如:
# v1 STORAGE = ['Mega', 'GoogleDrive'] # v2 STORAGE = Mega,GoogleDrive
-
本地存储(Local)已成为一种新的存储类型
要使用本地存储,在
STORAGE
中添加Local
,如:STORAGE=Local,Mega
本地存储像远程存储一样遵循
STORAGE_DIR
配置而非使用TEMP_DIR
。 -
Telegram 已成为一种存储类型
除了设置
ALBUM_ID
,还需在STORAGE
中添加Telegram
,如:ALBUM_ID=-100123456 STORAGE=Telegram,Mega
-
本地数据目录变更
本地数据,包括收藏的图片(
STORAGE_DIR
)和临时文件(TEMP_DIR
)已移动至应用根目录下的data
目录。请在应用目录中创建一个名为
data
的新目录,并将STORAGE_DIR
(默认为Picutres
)和TEMP_DIR
(默认为temp
)移动至该目录。
-
本地数据目录变更
数据库本地文件已移动至应用根目录下的
data
目录。请在应用目录中创建一个名为
data
的新目录,并将nazurin.json
和pixiv.json
之类的数据库文件移动至该目录。