-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDirectSender.java
67 lines (58 loc) · 1.53 KB
/
DirectSender.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package io.github.kloping.qqbot.api;
import io.github.kloping.qqbot.entities.qqpd.message.RawMessage;
import io.github.kloping.qqbot.entities.qqpd.message.RawPreMessage;
import io.github.kloping.qqbot.http.data.ActionResult;
import io.github.kloping.qqbot.http.data.Result;
import io.github.kloping.qqbot.impl.MessagePacket;
/**
* 私信发送者(消息)接口
*
* @author github.kloping
*/
public interface DirectSender extends Sender {
@Override
default Result<ActionResult> send(String text) {
return sendDirect(text);
}
@Override
default Result<ActionResult> send(String text, RawMessage message) {
return sendDirect(text, message);
}
@Override
default Result<ActionResult> send(MessagePacket packet) {
return sendDirect(packet);
}
@Override
default Result<ActionResult> send(RawPreMessage msg) {
return sendDirect(msg);
}
/**
* 以JSON方式发送文本消息
*
* @param text
* @return
*/
Result<ActionResult> sendDirect(String text);
/**
* 以JSON方式发送文本消息并引用指定消息
*
* @param text
* @param message
* @return
*/
Result<ActionResult> sendDirect(String text, RawMessage message);
/**
* 以自定义方式发送消息
*
* @param packet
* @return
*/
Result<ActionResult> sendDirect(MessagePacket packet);
/**
* 自定义消息
*
* @param msg
* @return
*/
Result<ActionResult> sendDirect(RawPreMessage msg);
}