mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bc4511e175 | ||
![]() |
f191103f99 | ||
![]() |
408463f63b | ||
![]() |
fb96c4272e | ||
![]() |
1dd468e2ff |
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 4,
|
"manifest_version": 4,
|
||||||
"type": "extension",
|
"type": "extension",
|
||||||
"name": "LLOneBot v3.27.0",
|
"name": "LLOneBot v3.27.2",
|
||||||
"slug": "LLOneBot",
|
"slug": "LLOneBot",
|
||||||
"description": "使你的NTQQ支持OneBot11协议进行QQ机器人开发",
|
"description": "使你的NTQQ支持OneBot11协议进行QQ机器人开发",
|
||||||
"version": "3.27.0",
|
"version": "3.27.2",
|
||||||
"icon": "./icon.jpg",
|
"icon": "./icon.jpg",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@@ -191,10 +191,11 @@ function onLoad() {
|
|||||||
postOb11Event(groupEvent)
|
postOb11Event(groupEvent)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
OB11Constructor.FriendAddEvent(message).then((friendAddEvent) => {
|
OB11Constructor.PrivateEvent(message).then((privateEvent) => {
|
||||||
if (friendAddEvent) {
|
log(message)
|
||||||
// log("post friend add event", friendAddEvent);
|
if (privateEvent) {
|
||||||
postOb11Event(friendAddEvent)
|
// log("post private event", privateEvent);
|
||||||
|
postOb11Event(privateEvent)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -205,20 +206,21 @@ function onLoad() {
|
|||||||
if (getConfigUtil().getConfig().enablePoke) {
|
if (getConfigUtil().getConfig().enablePoke) {
|
||||||
if ( qqPkgInfo.buildVersion > '23873'){
|
if ( qqPkgInfo.buildVersion > '23873'){
|
||||||
log(`当前版本${qqPkgInfo.buildVersion}不支持发送戳一戳模块`)
|
log(`当前版本${qqPkgInfo.buildVersion}不支持发送戳一戳模块`)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
crychic.loadNode()
|
else {
|
||||||
crychic.registerPokeHandler((id, isGroup) => {
|
crychic.loadNode()
|
||||||
log(`收到戳一戳消息了!是否群聊:${isGroup},id:${id}`)
|
crychic.registerPokeHandler((id, isGroup) => {
|
||||||
let pokeEvent: OB11FriendPokeEvent | OB11GroupPokeEvent
|
log(`收到戳一戳消息了!是否群聊:${isGroup},id:${id}`)
|
||||||
if (isGroup) {
|
let pokeEvent: OB11FriendPokeEvent | OB11GroupPokeEvent
|
||||||
pokeEvent = new OB11GroupPokeEvent(parseInt(id))
|
if (isGroup) {
|
||||||
}
|
pokeEvent = new OB11GroupPokeEvent(parseInt(id))
|
||||||
else {
|
}
|
||||||
pokeEvent = new OB11FriendPokeEvent(parseInt(id))
|
else {
|
||||||
}
|
pokeEvent = new OB11FriendPokeEvent(parseInt(id))
|
||||||
postOb11Event(pokeEvent)
|
}
|
||||||
})
|
postOb11Event(pokeEvent)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
registerReceiveHook<{
|
registerReceiveHook<{
|
||||||
msgList: Array<RawMessage>
|
msgList: Array<RawMessage>
|
||||||
|
@@ -47,7 +47,8 @@ import { mFaceCache } from '../ntqqapi/constructor'
|
|||||||
import { OB11FriendAddNoticeEvent } from './event/notice/OB11FriendAddNoticeEvent'
|
import { OB11FriendAddNoticeEvent } from './event/notice/OB11FriendAddNoticeEvent'
|
||||||
import { OB11FriendRecallNoticeEvent } from './event/notice/OB11FriendRecallNoticeEvent'
|
import { OB11FriendRecallNoticeEvent } from './event/notice/OB11FriendRecallNoticeEvent'
|
||||||
import { OB11GroupRecallNoticeEvent } from './event/notice/OB11GroupRecallNoticeEvent'
|
import { OB11GroupRecallNoticeEvent } from './event/notice/OB11GroupRecallNoticeEvent'
|
||||||
import { OB11GroupPokeEvent } from './event/notice/OB11PokeEvent'
|
import { OB11FriendPokeEvent, OB11GroupPokeEvent } from './event/notice/OB11PokeEvent'
|
||||||
|
import { OB11BaseNoticeEvent } from './event/notice/OB11BaseNoticeEvent';
|
||||||
|
|
||||||
let lastRKeyUpdateTime = 0
|
let lastRKeyUpdateTime = 0
|
||||||
|
|
||||||
@@ -309,6 +310,35 @@ export class OB11Constructor {
|
|||||||
return resMsg
|
return resMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async PrivateEvent(msg: RawMessage): Promise<OB11BaseNoticeEvent> {
|
||||||
|
if (msg.chatType !== ChatType.friend) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (const element of msg.elements) {
|
||||||
|
if (element.grayTipElement) {
|
||||||
|
if (element.grayTipElement.subElementType == GrayTipElementSubType.MEMBER_NEW_TITLE) {
|
||||||
|
const json = JSON.parse(element.grayTipElement.jsonGrayTipElement.jsonStr);
|
||||||
|
if (element.grayTipElement.jsonGrayTipElement.busiId == 1061) {
|
||||||
|
//判断业务类型
|
||||||
|
//Poke事件
|
||||||
|
let pokedetail: any[] = json.items;
|
||||||
|
//筛选item带有uid的元素
|
||||||
|
pokedetail = pokedetail.filter(item => item.uid);
|
||||||
|
if (pokedetail.length == 2) {
|
||||||
|
return new OB11FriendPokeEvent(parseInt((uidMaps[pokedetail[0].uid])!), parseInt((uidMaps[pokedetail[1].uid])));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//下面得改 上面也是错的grayTipElement.subElementType == GrayTipElementSubType.MEMBER_NEW_TITLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 好友增加事件
|
||||||
|
if (msg.msgType === 5 && msg.subMsgType === 12) {
|
||||||
|
const event = new OB11FriendAddNoticeEvent(parseInt(msg.peerUin))
|
||||||
|
return event
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static async GroupEvent(msg: RawMessage): Promise<OB11GroupNoticeEvent> {
|
static async GroupEvent(msg: RawMessage): Promise<OB11GroupNoticeEvent> {
|
||||||
if (msg.chatType !== ChatType.group) {
|
if (msg.chatType !== ChatType.group) {
|
||||||
return
|
return
|
||||||
@@ -515,17 +545,6 @@ export class OB11Constructor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async FriendAddEvent(msg: RawMessage): Promise<OB11FriendAddNoticeEvent | undefined> {
|
|
||||||
if (msg.chatType !== ChatType.friend) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (msg.msgType === 5 && msg.subMsgType === 12) {
|
|
||||||
const event = new OB11FriendAddNoticeEvent(parseInt(msg.peerUin))
|
|
||||||
return event
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
static async RecallEvent(
|
static async RecallEvent(
|
||||||
msg: RawMessage,
|
msg: RawMessage,
|
||||||
): Promise<OB11FriendRecallNoticeEvent | OB11GroupRecallNoticeEvent | undefined> {
|
): Promise<OB11FriendRecallNoticeEvent | OB11GroupRecallNoticeEvent | undefined> {
|
||||||
|
@@ -10,11 +10,10 @@ class OB11PokeEvent extends OB11BaseNoticeEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class OB11FriendPokeEvent extends OB11PokeEvent {
|
export class OB11FriendPokeEvent extends OB11PokeEvent {
|
||||||
sender_id: number
|
constructor(user_id: number, target_id: number) {
|
||||||
constructor(user_id: number) {
|
super();
|
||||||
super()
|
this.target_id = target_id;
|
||||||
this.user_id = user_id
|
this.user_id = user_id;
|
||||||
this.sender_id = user_id
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const version = '3.27.0'
|
export const version = '3.27.2'
|
||||||
|
Reference in New Issue
Block a user