style: lint

This commit is contained in:
手瓜一十雪
2025-02-02 20:17:28 +08:00
parent 90a82dcc9a
commit 76501bae34
135 changed files with 529 additions and 529 deletions

View File

@@ -148,7 +148,7 @@ export class OneBotGroupApi {
async parseOtherJsonEvent(msg: RawMessage, jsonStr: string, context: InstanceContext) {
const json = JSON.parse(jsonStr);
const type = json.items[json.items.length - 1]?.txt;
if (type === "头衔") {
if (type === '头衔') {
const memberUin = json.items[1].param[0];
const title = json.items[3].txt;
context.logger.logDebug('收到群成员新头衔消息', json);
@@ -158,7 +158,7 @@ export class OneBotGroupApi {
parseInt(memberUin),
title,
);
} else if (type === "移出") {
} else if (type === '移出') {
context.logger.logDebug('收到机器人被踢消息', json);
return;
} else {

View File

@@ -28,7 +28,7 @@ import { uriToLocalFile } from '@/common/file';
import { RequestUtil } from '@/common/request';
import fsPromise, { constants } from 'node:fs/promises';
import { OB11FriendAddNoticeEvent } from '@/onebot/event/notice/OB11FriendAddNoticeEvent';
import { ForwardMsgBuilder } from "@/common/forward-msg-builder";
import { ForwardMsgBuilder } from '@/common/forward-msg-builder';
import { NapProtoMsg } from '@napneko/nap-proto-core';
import { OB11GroupIncreaseEvent } from '../event/notice/OB11GroupIncreaseEvent';
import { OB11GroupDecreaseEvent, GroupDecreaseSubType } from '../event/notice/OB11GroupDecreaseEvent';
@@ -203,7 +203,7 @@ export class OneBotMsgApi {
const dir = emojiId.substring(0, 2);
const url = `https://gxh.vip.qq.com/club/item/parcel/item/${dir}/${emojiId}/raw300.gif`;
const filename = `${dir}-${emojiId}.gif`;
FileNapCatOneBotUUID.encode(peer, msg.msgId, elementWrapper.elementId, "", filename);
FileNapCatOneBotUUID.encode(peer, msg.msgId, elementWrapper.elementId, '', filename);
return {
type: OB11MessageDataType.image,
data: {
@@ -346,7 +346,7 @@ export class OneBotMsgApi {
peerUid: msg.peerUid,
guildId: '',
};
const fileCode = FileNapCatOneBotUUID.encode(peer, msg.msgId, elementWrapper.elementId, "", element.fileName);
const fileCode = FileNapCatOneBotUUID.encode(peer, msg.msgId, elementWrapper.elementId, '', element.fileName);
return {
type: OB11MessageDataType.voice,
data: {
@@ -657,14 +657,14 @@ export class OneBotMsgApi {
[OB11MessageDataType.miniapp]: async () => undefined,
[OB11MessageDataType.contact]: async ({ data: { type = "qq", id } }, context) => {
if (type === "qq") {
[OB11MessageDataType.contact]: async ({ data: { type = 'qq', id } }, context) => {
if (type === 'qq') {
const arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(id.toString(), '');
return this.ob11ToRawConverters.json({
data: { data: arkJson.arkMsg },
type: OB11MessageDataType.json
}, context);
} else if (type === "group") {
} else if (type === 'group') {
const arkJson = await this.core.apis.GroupApi.getGroupRecommendContactArkJson(id.toString());
return this.ob11ToRawConverters.json({
data: { data: arkJson.arkJson },

View File

@@ -1,7 +1,7 @@
import { GrayTipRovokeElement, NapCatCore, RawMessage } from '@/core';
import { NapCatOneBot11Adapter } from '@/onebot';
import { OB11ProfileLikeEvent } from '@/onebot/event/notice/OB11ProfileLikeEvent';
import { decodeProfileLikeTip } from "@/core/helper/adaptDecoder";
import { decodeProfileLikeTip } from '@/core/helper/adaptDecoder';
export class OneBotUserApi {
obContext: NapCatOneBot11Adapter;
@@ -15,12 +15,12 @@ export class OneBotUserApi {
async parseLikeEvent(wrappedBody: Uint8Array): Promise<OB11ProfileLikeEvent | undefined> {
const likeTip = decodeProfileLikeTip(wrappedBody);
if (likeTip?.msgType !== 0 || likeTip?.subType !== 203) return;
this.core.context.logger.logDebug("收到点赞通知消息");
this.core.context.logger.logDebug('收到点赞通知消息');
const likeMsg = likeTip.content.msg;
if (!likeMsg) return;
const detail = likeMsg.detail;
if (!detail) return;
const times = detail.txt.match(/\d+/) ?? "0";
const times = detail.txt.match(/\d+/) ?? '0';
return new OB11ProfileLikeEvent(
this.core,
Number(detail.uin),