Commit 0c964f3 1 parent d14261d commit 0c964f3 Copy full SHA for 0c964f3
File tree 2 files changed +6
-6
lines changed
mirai-core/src/commonMain/kotlin
mirai-core-api/src/commonMain/kotlin/message/action
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ public sealed class Nudge {
38
38
/* *
39
39
* 发送戳一戳消息到 [receiver].
40
40
*
41
- * 需要 [使用协议 ][BotConfiguration.protocol] [MiraiProtocol.ANDROID_PHONE].
41
+ * 需要使用支持的[协议 ][BotConfiguration.protocol] [MiraiProtocol.ANDROID_PHONE] 或 [MiraiProtocol.IPAD]. 自 2.10 起才支持使用 IPAD 协议发送 .
42
42
*
43
43
* @param receiver 这条 "戳一戳" 消息的接收对象. (不是 "戳" 动作的对象, 而是接收 "A 戳了 B" 这条消息的对象)
44
44
* @return 成功发送时为 `true`. 若对方禁用 "戳一戳" 功能, 返回 `false`.
45
- * @throws UnsupportedOperationException 当未使用 [安卓协议 ][MiraiProtocol.ANDROID_PHONE] 时抛出
45
+ * @throws UnsupportedOperationException 当未使用 [ANDROID_PHONE 协议 ][MiraiProtocol.ANDROID_PHONE] 或 [IPAD 协议][MiraiProtocol.IPAD ] 时抛出
46
46
*
47
47
* @see NudgeEvent 事件
48
48
* @see Contact.sendNudge
@@ -57,11 +57,11 @@ public sealed class Nudge {
57
57
/* *
58
58
* 发送戳一戳消息.
59
59
*
60
- * 需要 [使用协议 ][BotConfiguration.protocol] [MiraiProtocol.ANDROID_PHONE].
60
+ * 需要使用支持的[协议 ][BotConfiguration.protocol] [MiraiProtocol.ANDROID_PHONE] 或 [MiraiProtocol.IPAD]. 自 2.10 起才支持使用 IPAD 协议发送 .
61
61
*
62
62
* @return 成功发送时为 `true`. 若对方禁用 "戳一戳" 功能, 返回 `false`.
63
63
*
64
- * @throws UnsupportedOperationException 当未使用 [安卓协议 ][MiraiProtocol.ANDROID_PHONE] 时抛出
64
+ * @throws UnsupportedOperationException 当未使用 [ANDROID_PHONE 协议 ][MiraiProtocol.ANDROID_PHONE] 或 [IPAD 协议][MiraiProtocol.IPAD ] 时抛出
65
65
*
66
66
* @see NudgeEvent 事件
67
67
*/
Original file line number Diff line number Diff line change @@ -781,8 +781,8 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
781
781
}
782
782
783
783
override suspend fun sendNudge (bot : Bot , nudge : Nudge , receiver : Contact ): Boolean {
784
- if (bot.configuration.protocol != BotConfiguration .MiraiProtocol .ANDROID_PHONE ) {
785
- throw UnsupportedOperationException (" nudge is supported only with protocol ANDROID_PHONE" )
784
+ if (( bot.configuration.protocol != BotConfiguration .MiraiProtocol .ANDROID_PHONE ) && (bot.configuration.protocol != BotConfiguration . MiraiProtocol . IPAD ) ) {
785
+ throw UnsupportedOperationException (" nudge is supported only with protocol ANDROID_PHONE or IPAD " )
786
786
}
787
787
bot.asQQAndroidBot()
788
788
You can’t perform that action at this time.
0 commit comments