DonationAlerts-Minecraft
一个允许您接收 DonationAlerts 事件的模组。
支持:
- 捐赠
- Twitch Bits(Twitch 积分)
- Twitch Points(Twitch 点数)
- YouTube 和 Twitch 订阅
功能包括:
- 向聊天发送消息
- 执行任何 Minecraft 命令(包括模组命令)
设置
设置您的令牌 (Token)
您可以通过以下几种方式设置令牌。
使用 Minecraft 命令
- 从 DonationAlerts 服务复制令牌到剪贴板
- 在您的 Minecraft 聊天中执行命令
/da set
无需 将令牌插入聊天!令牌将从您的剪贴板获取。
使用文件
- 打开文件
Windows: C:\Users\<your user>\.donation-alerts-token
Linux: ~/.donation-alerts-token
- 将您的令牌粘贴到文件中
- 保存
连接到 Donation Alerts
要连接到 Donation Alerts,请使用 Minecraft 中的命令
/da connect
要检查连接状态,您可以使用命令
/da status
以及断开连接的命令
/da disconnect
配置
设置文件位于 .minecraft/donation-alerts-integrate/settings.yaml
文件格式为 yaml,示例如下:
disableSettingsUpdateMessage: false
disableWelcomeMessage: false
triggers:
- name: default
description: 示例触发器
isActive: true
sensitives:
- properties:
type: daintegrate/sensitive/donate
value:
from: 5
to: 10
currency: USD
handlers:
- delay: 0 # 您可以在这里输入任何注释!
properties:
type: daintegrate/handler/message
value:
message: Hello, <donation_username>! This is an example message for all events from Donation Alerts
- delay: 10
properties:
type: daintegrate/handler/command
value:
command: time set day # The sun is rising
- name: Subscribtion
isActive: true
sensitives:
- properties:
type: daintegrate/sensitive/subscribe
value:
type: YouTubeSubscription
handlers:
- properties:
type: daintegrate/handler/message
value:
message: <donation_username> just subscribe to YouTube!
triggers 是一个事件列表,可由来自 Donation Alerts 的每条消息触发。
| 属性 |
描述 |
| name |
触发器的名称 |
| description |
触发器的描述 |
| isActive |
启用或禁用触发器。 如果 isActive = false,则不会激活该触发器 |
| sensitive |
触发激活的条件 参见 #Sensitive 以了解更多 |
| handlers |
触发器内的处理程序,执行任何已注册的命令。 您可以创建自己的模组以添加自定义处理程序 参见 #Handlers 以了解更多 |
Sensitive(敏感条件)
触发激活的条件。
DonationAlertsIntegrate 提供多种敏感条件类型。
| 类型 |
描述 |
daintegrate/sensitive/always |
对任何事件激活 |
daintegrate/sensitive/donate |
对特定捐赠激活 |
daintegrate/sensitive/subscribe |
对订阅激活 |
daintegrate/sensitive/twitch/bits |
对特定 Bits 激活 |
Always(总是)
参数
无参数
示例
sensitives:
- properties:
type: daintegrate/sensitive/always
Donate(捐赠)
如果金额落在指定范围内 (from <= 金额 <= to) 且货币匹配,则激活。
参数
| 名称 |
类型 |
描述 |
from |
number |
左侧数值 |
to |
number |
右侧数值 |
currency |
text |
ISO 4217 代码中的货币 |
示例
sensitives:
- properties:
type: daintegrate/sensitive/donate
value:
from: 5
to: 10
currency: USD
Subscribe(订阅)
如果 type 匹配,则激活。
参数
| 名称 |
类型 |
描述 |
type |
enum |
要匹配的類型,可用類型见下文 |
可用类型
- YouTubeSubscription
- TwitchSubscription
- TwitchFreeFollow
- TwitchGiftSubscription
- TwitchPrimeSubscription
示例
sensitives:
- properties:
type: daintegrate/sensitive/subscribe
value:
type: YouTubeSubscription
Twitch points(Twitch 点数)
如果 Twitch 点数落在指定范围内 (from <= 数量 <= to),则激活。
参数
| 名称 |
类型 |
描述 |
from |
number |
Twitch bits 数量的左侧值 |
to |
number |
Twitch bits 数量的右侧值 |
示例
sensitives:
- properties:
type: daintegrate/sensitive/twitch/points
value:
from: 0
to: 1000
Twitch bits(Twitch Bits)
如果 Twitch Bits 数量落在指定范围内 (from <= 数量 <= to),则激活。
参数
| 名称 |
类型 |
描述 |
from |
number |
Twitch bits 数量的左侧值 |
to |
number |
Twitch bits 数量的右侧值 |
示例
sensitives:
- properties:
type: daintegrate/sensitive/twitch/bits
value:
from: 0
to: 2000
Handlers(处理程序)
触发器的处理程序。
当触发器激活时执行操作。
| 类型 |
描述 |
daintegrate/handler/message |
向您的聊天添加消息 |
daintegrate/handler/command |
代替您向服务器发送命令 |
Delay
每个处理器除了 properties 对象外,还有一个 delay 属性,表示命令将在多少个刻(ticks)后执行。
在 Minecraft 中,默认情况下 1 秒等于 20 个刻
替换模式
在命令和消息中,你可以指定将被替换为相应值的模式。
<donation_message>
<donation_amount>
<donation_currency>
<donation_username>
<minecraft_playername>
消息
向你的聊天添加一条消息
参数
| 名称 |
类型 |
描述 |
message |
文本 |
将添加到聊天栏的一条消息 |
示例
handlers:
- delay: 10
properties:
type: daintegrate/handler/message
value:
message: Hello! It's day time!
Command
以你的身份向服务器发送一条命令
参数
| 名称 |
类型 |
描述 |
command |
文本 |
将发送到服务器的命令(不带斜杠 /) |
示例
handlers:
- delay: 10
properties:
type: daintegrate/handler/command
value:
command: time set day
DonationAlerts-Minecraft
A modification that allows you to receive events from DonationAlerts
Supports:
- Donation
- Twitch Bits
- Twitch Points
- Subscriptions to YouTube and Twitch
Allows to:
- Send message to the chat
- Execute any Minecraft commands (include mods)
Setup
Setup your token
There are several ways to set your token here.
With minecraft command
- Copy the token to the clipboard from DonationAlerts service
- Execute command in your minecraft chat
/da set
NO NEED to insert a token into the chat! The token will be taken from your clipboard.
With file
- Open the file
Windows: C:\Users\<your user>\.donation-alerts-token
Linux: ~/.donation-alerts-token
- Paste your token to the file
- Save
Connect to the Donation Alerts
To connect to Donation Alerts, use the command in Minecraft
/da connect
To check connection status you can use command
/da status
And there is the command to disconnect
/da disconnect
Configuration
The settings file is in .minecraft/donation-alerts-integrate/settings.yaml
The file format is yaml, example:
disableSettingsUpdateMessage: false
disableWelcomeMessage: false
triggers:
- name: default
description: example trigger
isActive: true
sensitives:
- properties:
type: daintegrate/sensitive/donate
value:
from: 5
to: 10
currency: USD
handlers:
- delay: 0 # Any comment you can type here!
properties:
type: daintegrate/handler/message
value:
message: Hello, <donation_username>! This is an example message for all events from Donation Alerts
- delay: 10
properties:
type: daintegrate/handler/command
value:
command: time set day # The sun is rising
- name: Subscribtion
isActive: true
sensitives:
- properties:
type: daintegrate/sensitive/subscribe
value:
type: YouTubeSubscription
handlers:
- properties:
type: daintegrate/handler/message
value:
message: <donation_username> just subscribe to YouTube!
triggers is a list of events that can trigger by each message from donation alerts
| Property |
Description |
| name |
Just a name of trigger |
| description |
Description of trigger |
| isActive |
Enables or disables the trigger. If isActive = false, the trigger will not be activated |
| sensitive |
Conditions for trigger activation see #Sensitive for learn more |
| handlers |
Handlers inside the trigger, execute any registered commands. You can create your own mod that will add a custom handler See #Handlers for lean more |
Sensitive
Conditions for trigger activation.
The DonationAlertsIntegrate provides multiple sensitive
| Type |
Description |
daintegrate/sensitive/always |
Activates for any event |
daintegrate/sensitive/donate |
Activates for specific donation |
daintegrate/sensitive/subscribe |
Activates for subscribe |
daintegrate/sensitive/twitch/bits |
Activates for specific bits |
Always
Parameters
Has no parameters
Example
sensitives:
- properties:
type: daintegrate/sensitive/always
Donate
Activates if the amount falls within the specified range (from <= amount <= to).
And the currency matches.
Parameters
| Name |
Type |
Description |
from |
number |
Left side number |
to |
number |
Right side number |
currency |
text |
Currency in the ISO 4217 code |
Example
sensitives:
- properties:
type: daintegrate/sensitive/donate
value:
from: 5
to: 10
currency: USD
Subscribe
Activates if the type is matches
Parameters
| Name |
Type |
Description |
type |
enum |
Type to match, see below for available types |
Available types
- YouTubeSubscription
- TwitchSubscription
- TwitchFreeFollow
- TwitchGiftSubscription
- TwitchPrimeSubscription
Example
sensitives:
- properties:
type: daintegrate/sensitive/subscribe
value:
type: YouTubeSubscription
Twitch points
Activates if the amount of Twitch points falls within the specified range (from <= amount <= to).
Parameters
| Name |
Type |
Description |
from |
number |
Left side of the Twitch bits amount |
to |
number |
Right side of the Twitch bits amount |
Example
sensitives:
- properties:
type: daintegrate/sensitive/twitch/points
value:
from: 0
to: 1000
Twitch bits
Activates if the amount of Twitch bits falls within the specified range (from <= amount <= to).
Parameters
| Name |
Type |
Description |
from |
number |
Left side of the Twitch bits amount |
to |
number |
Right side of the Twitch bits amount |
Example
sensitives:
- properties:
type: daintegrate/sensitive/twitch/bits
value:
from: 0
to: 2000
Handlers
Handlers for the trigger.
Perform actions when the trigger is activated.
| Type |
Description |
daintegrate/handler/message |
Adds a message to your chat |
daintegrate/handler/command |
Sends a command to the server on your behalf |
Delay
Each handler, in addition to the properties object, has a delay property, it indicates after how many ticks the command will be executed.
By default, 1 second in minecraft is 20 ticks
Replace patterns
In commands and messages, you can specify patterns that will be replaced with the corresponding values.
<donation_message>
<donation_amount>
<donation_currency>
<donation_username>
<minecraft_playername>
Message
Adds a message to your chat
Parameters
| Name |
Type |
Description |
message |
text |
A message which will be added to the chat |
Example
handlers:
- delay: 10
properties:
type: daintegrate/handler/message
value:
message: Hello! It's day time!
Command
Sends a command to the server on your behalf
Parameters
| Name |
Type |
Description |
command |
text |
A command which will be send to the server (without slash /) |
Example
handlers:
- delay: 10
properties:
type: daintegrate/handler/command
value:
command: time set day
评论 0
登录后参与评分
还没有评论,来抢沙发吧