README.md

This commit is contained in:
coooookies 2022-05-03 18:49:17 +08:00
parent c581488c7d
commit 4be39aaca3
2 changed files with 140 additions and 8 deletions

View File

@ -2,7 +2,7 @@
# MeaMailPlus - Grasscutter Mail enhancements
MeaMailPlus is a plugin of [Grasscutter](https://github.com/Grasscutters/Grasscutter), you can use this plugin to send your mail conveniently.
English | 简体中文 (正在写)
English | [简体中文](./README_CN.md)
## 💡Feature
@ -41,8 +41,8 @@ Run command `/meamail reload` in console to reload the config.
```
{
"updateTime": [4, 0, 0], // set the server's start time for send mail of the day, default is 04:00:00(24 hours system)
"initialMail": [ 1001 ], // set the initial mail id, you can set multiple mail ids like [1001, 1002, 1003]
"birthDayMail": [ 1004 ], // set the birthday mail id, you can set multiple mail too!
"initialMail": [ 1001 ], // set the initial mail template id, you can set multiple mail ids like [1001, 1002, 1003]
"birthDayMail": [ 1004 ], // set the birthday mail template id, you can set multiple mail too!
"dailySignInMail": [ // players can only receive once a day, and will not send if they are not online.
{
@ -68,7 +68,7 @@ Run command `/meamail reload` in console to reload the config.
},
{ // multiple mail...
"onlineOnly": true,
"triggerTime": [6, 0, 0], // 16:00:00
"triggerTime": [16, 0, 0], // 16:00:00
"templateId": 1003,
"minLevel": 0
},
@ -87,7 +87,7 @@ like this:
TemplateExample.json
```
{
"templateId": 1001, // Your template id
"templateId": 1001, // Your template id, can't be repeated
"title": "Mail title", // Your Mail title
"sender": "KiritaniIwako", // Your sender name, you can set "Server"
"expireTime": 0, // Your mail expire time, will be explained in detail later.
@ -99,7 +99,7 @@ TemplateExample.json
{
"id": 223, // item id
"count": 1, // amount
"level": 1 // item level(1-90?)
"level": 1 // item level(0-90?)
}
]
}

View File

@ -34,7 +34,139 @@ Root
### 怎么用?
🤔 正在写......
在插件目录中的`MeaMailPlus`目录下, 包含 `template` 文件夹和 `config.json` 配置文件
#### 配置文件设置
配置文件是一个 `JSON` 格式的文件。你可以通过修改配置文件来控制插件的行为。
配置完后在Console中输入`/meamail reload`即可重载配置文件。
```
{
"updateTime": [4, 0, 0], // 设置服务器的邮件推送时间,这里设置的是 04:00:00 (24小时时间制)
"initialMail": [ 1001 ], // 设置新玩家第一次进服时接收的邮件TemplateId可以设置很多个例如 [1001, 1002, 1003]
"birthDayMail": [ 1004 ], // 设置玩家生日邮件TemplateId当然也可以设置很多个如果玩家有点贪
"dailySignInMail": [ // 玩家每日登录的邮件,会在每天推送时间或者是玩家上线时发送,一天只能领取一次,不上线就没有。
{
"templateId": 1002, // 邮件的TemplateId
"minLevel": 0 // 设置冒险等级限制0表示不限制小于这个冒险等级的玩家不会收到邮件
},
{
"templateId": 1003, // 设置多个邮件...
"minLevel": 25
},
{
"templateId": 1004, // 设置多个邮件...
"minLevel": 55
}
],
"dailyRepetitionMail": [ // 设置每日定时邮件
{
"onlineOnly": false, // 是否只有在线玩家能接收邮件,如果设置成离线,则所有玩家都能接收到
"triggerTime": [12, 0, 0], // 触发时间 这里是 12:00:00
"templateId": 1003, // 邮件templateId
"minLevel": 0 // 设置冒险等级限制0表示不限制小于这个冒险等级的玩家不会收到邮件
},
{ // 设置多个邮件...
"onlineOnly": true,
"triggerTime": [16, 0, 0], // 16:00:00
"templateId": 1003,
"minLevel": 0
},
{ // 设置多个邮件...
"onlineOnly": true,
"triggerTime": [0, 0, 0], // 24:00:00
"templateId": 1003,
"minLevel": 0
}
]
}
```
#### Template 模板文件
你可以自行创建模板文件放进 `template` 文件夹, 同样只支持 `JSON`文件.
举个栗子:
TemplateExample.json
```
{
"templateId": 1001, // 你的邮件TemplateID不能重复。
"title": "Mail title", // 邮件标题
"sender": "KiritaniIwako", // 邮件发送人,你可以设置为 "Server"
"expireTime": 0, // 过期时间,稍后会详细介绍
"remainTime": 2592000, // 剩余时间,如果你设置了剩余时间,则过期时间不会生效
"importance": 0, // 邮件重要等级0为默认1为收藏
"body": { // 邮件内容,稍后会详细介绍
"content": "Mail content",
"items": [
{
"id": 223, // 物品id
"count": 1, // 数量
"level": 1 // 等级(0-90?)
}
]
}
}
```
1. 如何设置过期时间 `expireTime` 或者是剩余时间 `remainTime`?
- [时间戳转换器](https://tool.lu/timestamp/)
```
{
"expireTime": 1651571451,
// use 10 digits timestamp, like this:
// you can use convert tool to convert the timestamp to 10 digits timestamp,
// https://tool.lu/timestamp/
"remainTime": 2592000
// time in second
// 2592000 is the seconds of 30 days:
// 2592000 = (d) * 24(h) * 60(m) * 60(s)
// if you are not sure, you can use two 10 digits timestamp subtraction:
// 2592000 = 1651568400 (2022-5-3 9:00:00GMT) - 1648976400 (2022-4-3 9:00:00GMT)
}
```
2. How to set the mail `body/content`?
```
{
"body": {
"content": "Mail content",
// you can set the content of the mail,
// you can use the variable:
// `{playerName}`: (Testing) player name
// `\r\n`: line feed
// you can use link to open Webview in-game & Browser:
// `<type=\"browser\" text=\"Discord\" href=\"https://discord.gg/T5vZU6UyeG\"/>`: open a Browser, tag name is "Discord".
// `<type=\"webview\" text=\"Discord\" href=\"https://discord.gg/T5vZU6UyeG\"/>`: open a Browser, tag name is "Discord".
"items": [ // items in the mail, if you set `[]`, no item will be sent
{
"id": 223,
"count": 1,
"level": 1
}
{
"id": 223, // item id
"count": 1, // amount
"level": 1 // item level(1-90?)
},
{
"id": 224, // Multiple items...
"count": 1,
"level": 1
},
{
"id": 202, // Multiple items...
"count": 10000000,
"level": 1
}
]
}
}
```
Hyperlinks in the mail content:
```
<type=\"browser\" text=\"Discord\" href=\"https://discord.gg/T5vZU6UyeG\"/>
<type=\"webview\" text=\"Discord\" href=\"https://discord.gg/T5vZU6UyeG\"/>
```
### 命令和权限
Command: