/** * Wechaty Chatbot SDK - https://github.com/wechaty/wechaty * * @copyright 2016 Huan LI (李卓桓) , and * Wechaty Contributors . * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ import type * as PUPPET from '@juzi/wechaty-puppet'; import type { FileBoxInterface } from 'file-box'; import type { Constructor } from 'clone-class'; import { ContactImpl } from './contact.js'; import type { RoomInterface } from './room.js'; declare const MixinBase: ((abstract new (...args: any[]) => {}) & { _pool?: Map | undefined; readonly pool: Map; load & { new (...args: any[]): ContactSelfInterface; prototype: ContactSelfInterface; } & import("../user-mixins/poolify.js").PoolifyMixin>(this: L, id: string): ContactSelfInterface; }) & typeof ContactImpl; /** * Bot itself will be encapsulated as a ContactSelf. * * > Tips: this class is extends Contact * @example * const bot = new Wechaty() * await bot.start() * bot.on('login', (user: ContactSelf) => { * console.log(`user ${user} login`) * }) */ declare class ContactSelfMixin extends MixinBase { static find(query: string | PUPPET.filters.Contact): Promise; avatar(): Promise; avatar(file: FileBoxInterface): Promise; /** * Get bot qrcode * * @returns {Promise} * * @example * import { generate } from 'qrcode-terminal' * bot.on('login', (user: ContactSelf) => { * console.log(`user ${user} login`) * const qrcode = await user.qrcode() * console.log(`Following is the bot qrcode!`) * generate(qrcode, { small: true }) * }) */ qrcode(): Promise; /** * Change bot name * * @param name The new name that the bot will change to * * @example * bot.on('login', async user => { * console.log(`user ${user} login`) * const oldName = user.name() * try { * await user.name(`${oldName}-${new Date().getTime()}`) * } catch (e) { * console.error('change name failed', e) * } * }) */ name(): string; name(name: string): Promise; realName(): string; realName(realName: string): Promise; aka(): string; aka(aka: string): Promise; /** * Change bot signature * * @param signature The new signature that the bot will change to * * @example * bot.on('login', async user => { * console.log(`user ${user} login`) * try { * await user.signature(`Signature changed by wechaty on ${new Date()}`) * } catch (e) { * console.error('change signature failed', e) * } * }) */ signature(signature: string): Promise; roomAlias(room: RoomInterface, alias?: string): Promise; } declare const ContactSelfImpl_base: { new (...args: any[]): {}; valid: (o: any) => o is ContactSelfInterface; validInstance: (target: any) => target is ContactSelfMixin; validInterface: (target: any) => target is ContactSelfInterface; } & typeof ContactSelfMixin; declare class ContactSelfImpl extends ContactSelfImpl_base { } interface ContactSelfInterface extends ContactSelfImpl { } declare type ContactSelfConstructor = Constructor>; export type { ContactSelfConstructor, ContactSelfInterface, }; export { ContactSelfImpl, }; //# sourceMappingURL=contact-self.d.ts.map