refactor: rename all coreContext -> core

This commit is contained in:
Wesley F. Young
2024-08-26 09:19:50 +08:00
parent a5f9e44ebb
commit 04fb771f42
79 changed files with 386 additions and 389 deletions

View File

@@ -5,15 +5,15 @@ import { OB11FriendPokeEvent } from '../event/notice/OB11PokeEvent';
export class OneBotFriendApi {
obContext: NapCatOneBot11Adapter;
coreContext: NapCatCore;
core: NapCatCore;
friendList: Map<string, any> = new Map();//此处作为缓存 uin->info
constructor(obContext: NapCatOneBot11Adapter, coreContext: NapCatCore) {
constructor(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
this.obContext = obContext;
this.coreContext = coreContext;
this.core = core;
}
//使用前预先判断 busiId 1061
async parsePrivatePokeEvent(grayTipElement: GrayTipElement) {
const NTQQUserApi = this.coreContext.apis.UserApi;
const NTQQUserApi = this.core.apis.UserApi;
const json = JSON.parse(grayTipElement.jsonGrayTipElement.jsonStr);
let pokedetail: any[] = json.items;
//筛选item带有uid的元素
@@ -21,7 +21,7 @@ export class OneBotFriendApi {
//console.log("[NapCat] 群拍一拍 群:", pokedetail, parseInt(msg.peerUid), " ", await NTQQUserApi.getUinByUid(pokedetail[0].uid), "拍了拍", await NTQQUserApi.getUinByUid(pokedetail[1].uid));
if (pokedetail.length == 2) {
return new OB11FriendPokeEvent(
this.coreContext,
this.core,
parseInt((await NTQQUserApi.getUinByUidV2(pokedetail[0].uid))!),
parseInt((await NTQQUserApi.getUinByUidV2(pokedetail[1].uid))!),
pokedetail