generated from zhinjs/qq-official-bot
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
445 additions
and
10,235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {User} from "@/entries/user"; | ||
import {Client} from "@"; | ||
|
||
export class ChannelMember extends User{ | ||
constructor(c:Client,public channel_id:string,info:User.Info) { | ||
super(c,info); | ||
} | ||
} | ||
export namespace ChannelMember{ | ||
export const map:WeakMap<User.Info,ChannelMember>=new WeakMap<User.Info, ChannelMember>() | ||
export function as(this:Client,channel_id:string,user_id:string){ | ||
const memberInfo=this.channelMembers.get(channel_id)?.get(user_id) | ||
if(!memberInfo) throw new Error(`频道(${channel_id}) 不存在成员(${user_id})`) | ||
if(map.has(memberInfo)) return map.get(memberInfo) | ||
const member=new ChannelMember(this,channel_id,memberInfo) | ||
map.set(memberInfo,member) | ||
return member | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { BaseClient, Quotable, Sendable, Message} from "@"; | ||
import {Quotable, Sendable, Message, Client} from "@"; | ||
|
||
export abstract class Contact { | ||
protected constructor(public c: BaseClient) { | ||
protected constructor(public c: Client) { | ||
} | ||
|
||
abstract sendMsg(message:Sendable,quote?:Quotable):Promise<Message.Ret> | ||
abstract updateMsg(message_id:string,newMessage:Sendable,quote?:Quotable):Promise<boolean> | ||
abstract recallMsg(message_id:string):Promise<boolean> | ||
abstract getMsg(message_id:string):Promise<Message> | ||
} |
Oops, something went wrong.