Skip to content

Commit

Permalink
api: 补充私聊API相关方法
Browse files Browse the repository at this point in the history
  • Loading branch information
RealHeart committed Sep 24, 2022
1 parent a0010b9 commit 7409164
Showing 1 changed file with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
package me.zhenxin.qqbot.api.impl;

import me.zhenxin.qqbot.api.BaseApi;
import me.zhenxin.qqbot.entity.AccessInfo;
import me.zhenxin.qqbot.entity.DirectMessageSession;
import me.zhenxin.qqbot.entity.Message;
import me.zhenxin.qqbot.entity.MessageEmbed;
import me.zhenxin.qqbot.entity.*;
import me.zhenxin.qqbot.entity.ark.MessageArk;
import me.zhenxin.qqbot.exception.ApiException;

Expand Down Expand Up @@ -133,7 +130,37 @@ public Message sendMessage(String guildId, MessageEmbed embed, String messageId)
}

/**
* 撤回消息
* 发送Markdown消息
*
* @param guildId 频道ID
* @param markdown {@link MessageMarkdown} 对象
* @param messageId 消息ID
* @return {@link Message} 对象
*/
public Message sendMessage(String guildId, MessageMarkdown markdown, String messageId) throws ApiException {
Map<String, Object> data = new HashMap<>();
data.put("markdown", markdown);
data.put("msg_id", messageId);
return sendMessage(guildId, data);
}

/**
* 发送Keyboard消息
*
* @param guildId 频道ID
* @param keyboard {@link MessageKeyboard} 对象
* @param messageId 消息ID
* @return {@link Message} 对象
*/
public Message sendMessage(String guildId, MessageKeyboard keyboard, String messageId) {
Map<String, Object> data = new HashMap<>();
data.put("keyboard", keyboard);
data.put("msg_id", messageId);
return sendMessage(guildId, data);
}

/**
* 撤回消息 (仅私域可用)
*
* @param guildId 频道ID
* @param messageId 消息ID
Expand Down

0 comments on commit 7409164

Please sign in to comment.