MCPcopy Create free account
hub / github.com/Kloping/qqpd-bot-java / Dms

Class Dms

src/main/java/io/github/kloping/qqbot/entities/qqpd/Dms.java:25–94  ·  view source on GitHub ↗

字段名 类型 描述 guild_id string 私信会话关联的频道 id channel_id string 私信会话关联的子频道 id create_time string 创建私信会话时间戳 @author gi

Source from the content-addressed store, hash-verified

23 * @author github.kloping
24 */
25@Data
26public class Dms implements DirectSender, SenderAndCidMidGetter {
27 private String guildId;
28 private String channelId;
29 private String createTime;
30
31 /**
32 * 此方式为主动消息
33 *
34 * @param text
35 * @return
36 */
37 @Override
38 public Result<ActionResult> sendDirect(String text) {
39 return sendDirect(new MessagePacket().setContent(text));
40 }
41
42 /**
43 * 此方式为主动消息
44 *
45 * @param text
46 * @param message
47 * @return
48 */
49 @Override
50 public Result<ActionResult> sendDirect(String text, RawMessage message) {
51 return sendDirect(new MessagePacket().setContent(text).setReplyId(message.getId()));
52 }
53
54 /**
55 * 此方式为主动消息
56 *
57 * @param packet
58 * @return
59 */
60 @Override
61 public Result<ActionResult> sendDirect(MessagePacket packet) {
62 RawPreMessage msg = new RawPreMessage();
63 BaseUtils.packet2pre(packet, msg);
64 return new Result<>(bot.dmsBase.send(this.guildId, msg, SEND_MESSAGE_HEADERS));
65 }
66
67 @Override
68 public Result<ActionResult> sendDirect(RawPreMessage msg) {
69 return new Result<>(bot.dmsBase.send(this.guildId, msg, SEND_MESSAGE_HEADERS));
70 }
71
72 @Override
73 public Result<ActionResult> send(SendAble msg) {
74 return msg.send(this);
75 }
76
77 @Override
78 public String getCid() {
79 return channelId;
80 }
81
82 @Getter

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected