允许以仅用于调用方法的模式进行部分对象的实例化
This commit is contained in:
@@ -19,6 +19,11 @@ export default class Chat extends BaseClientObject {
|
|||||||
* 实例化方法
|
* 实例化方法
|
||||||
* ================================================
|
* ================================================
|
||||||
*/
|
*/
|
||||||
|
static getForInvokeOnlyById(client: LingChairClient, id: string) {
|
||||||
|
return new Chat(client, {
|
||||||
|
id
|
||||||
|
} as ChatBean)
|
||||||
|
}
|
||||||
static async getById(client: LingChairClient, id: string) {
|
static async getById(client: LingChairClient, id: string) {
|
||||||
try {
|
try {
|
||||||
return await this.getByIdOrThrow(client, id)
|
return await this.getByIdOrThrow(client, id)
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ export default class User extends BaseClientObject {
|
|||||||
* 实例化方法
|
* 实例化方法
|
||||||
* ================================================
|
* ================================================
|
||||||
*/
|
*/
|
||||||
|
static getForInvokeOnlyById(client: LingChairClient, id: string) {
|
||||||
|
return new User(client, {
|
||||||
|
id
|
||||||
|
} as UserBean)
|
||||||
|
}
|
||||||
static async getById(client: LingChairClient, id: string) {
|
static async getById(client: LingChairClient, id: string) {
|
||||||
try {
|
try {
|
||||||
return await this.getByIdOrThrow(client, id)
|
return await this.getByIdOrThrow(client, id)
|
||||||
|
|||||||
Reference in New Issue
Block a user