Skip to content

Commit

Permalink
Revert "refactor: CardChangedEvent"
Browse files Browse the repository at this point in the history
This reverts commit 0e8ceeb.
  • Loading branch information
MliKiowa committed Dec 5, 2024
1 parent 6f232c4 commit 8d857cf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/onebot/api/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export class OneBotGroupApi {
if (memberUin && adminUin) {
return new OB11GroupBanEvent(
this.core,
+GroupCode,
+memberUin,
+adminUin,
parseInt(GroupCode),
parseInt(memberUin),
parseInt(adminUin),
duration,
subType,
);
Expand Down Expand Up @@ -98,8 +98,8 @@ export class OneBotGroupApi {
}
return new OB11GroupMsgEmojiLikeEvent(
this.core,
+groupCode,
+senderUin,
parseInt(groupCode),
parseInt(senderUin),
MessageUnique.getShortIdByMsgId(replyMsg.msgId)!,
[{
emoji_id: emojiId,
Expand All @@ -111,10 +111,9 @@ export class OneBotGroupApi {
async parseCardChangedEvent(msg: RawMessage) {
if (msg.senderUin && msg.senderUin !== '0') {
const member = await this.core.apis.GroupApi.getGroupMember(msg.peerUid, msg.senderUin);
const oldName = member?.cardName || member?.nick || '';
if (member && oldName !== msg.sendMemberName) {
if (member && member.cardName !== msg.sendMemberName) {
const newCardName = msg.sendMemberName ?? '';
const event = new OB11GroupCardEvent(this.core, parseInt(msg.peerUid), parseInt(msg.senderUin), newCardName, oldName);
const event = new OB11GroupCardEvent(this.core, parseInt(msg.peerUid), parseInt(msg.senderUin), newCardName, member.cardName);
member.cardName = newCardName;
return event;
}
Expand Down

0 comments on commit 8d857cf

Please sign in to comment.