import { Client } from 'discord.js-selfbot-v13'; import { MultiToolClientOption } from '../../typing/index'; export class MultiToolClient extends Client { customOption: MultiToolClientOption; log: any; constructor(public option?: MultiToolClientOption) { super(); this.customOption = option; this.log = this.customOption.customLogger || console.log; } async connect(token: string): Promise { if (!token) { throw new Error('Token is required'); } if (token.length < 5) { throw new Error('Token is too short'); } return await super .login(token) .then(() => { if (this?.customOption?.isReadyNotice) { const readyText: string = this.customOption.isReadyNoticeMessage || ' is ready!'; return this.log( readyText.replace('', this.user.username) ); } else { return; } }) .catch((err) => { throw new Error(err); }); } }