<a href="https://github.com/Kloping/qqpd-bot-java/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Kloping/qqpd-bot-java" alt="License"></a>
<a href="https://github.com/Kloping/qqpd-bot-java/releases"><img src="https://img.shields.io/github/v/release/Kloping/qqpd-bot-java?color=blueviolet&include_prereleases" alt="release"></a>
非官方 可用于 Java 8+
Java SDK主要基于基础 API (opens new window)封装,提供给用户一种简单、高效的使用方式。
@EventReceiver注解驱动)websocket与webhook方式链接Maven
<dependency>
<groupId>io.github.kloping</groupId>
<artifactId>bot-qqpd-java</artifactId>
<version>1.5.3-L1</version>
</dependency>
Gradle
implementation 'io.github.kloping:bot-qqpd-java:1.5.3-L1'
~~2. 发布审核 发布后为公域~~
启动方式
Starter starter = new Starter("appid","token");
//如果使用q群 则 new Starter("appid", "token", "secret");
starter.getConfig().setCode(Intents.PRIVATE_INTENTS.getCode());
// webhook 链接方式
//starter.getConfig().setWebhookport(81);
starter.run();
V1.5.0-Beta7+ 注册监听器主机方式 [荐]
starter.registerListenerHost(new ListenerHost(){
@EventReceiver
public void onEvent(MessageEvent event){
event.send("测试通过");
}
});
V1.4.6
事件订阅 默认的事件订阅 不会接收消息事件
需要确定自己的机器人是公域还是私域
//单事件订阅方式
starter.getConfig().setCode(Intents.GUILD_MESSAGES.getCode());
//多事件订阅方式
starter.getConfig().setCode(Intents.START.and(Intents.GUILD_MESSAGES,Intents.DIRECT_MESSAGE));
// 公域机器人订阅推荐
starter.getConfig().setCode(Intents.PUBLIC_INTENTS.getCode());
// 私域机器人订阅推荐
starter.getConfig().setCode(Intents.PRIVATE_INTENTS.getCode());
import io.github.kloping.qqbot.Starter;
import io.github.kloping.qqbot.api.Intents;
import io.github.kloping.qqbot.api.message.MessageChannelReceiveEvent;
import io.github.kloping.qqbot.api.message.MessageDirectReceiveEvent;
import io.github.kloping.qqbot.impl.ListenerHost;
更多使用方式参考查看 test
$ claude mcp add qqpd-bot-java \
-- python -m otcore.mcp_server <graph>