chore: how to implement MFA?

This commit is contained in:
Elysia
2024-09-17 21:12:11 +07:00
parent f7e328e569
commit cda3231c5a
4 changed files with 6 additions and 0 deletions

View File

@@ -287,6 +287,7 @@ class Client extends BaseClient {
* *
* @example * @example
* client.passLogin("test@gmail.com", "SuperSecretPa$$word", 1234) * client.passLogin("test@gmail.com", "SuperSecretPa$$word", 1234)
* @deprecated This method will not be updated until I find the most convenient way to implement MFA.
*/ */
async passLogin(email, password, code = null) { async passLogin(email, password, code = null) {
const initial = await this.api.auth.login.post({ const initial = await this.api.auth.login.post({

View File

@@ -228,6 +228,7 @@ class GuildBanManager extends CachedManager {
* console.log(`Banned ${result.bannedUsers.length} users, failed to ban ${result.failedUsers.length} users.`) * console.log(`Banned ${result.bannedUsers.length} users, failed to ban ${result.failedUsers.length} users.`)
* }) * })
* .catch(console.error); * .catch(console.error);
* @deprecated This method will not be usable until an effective MFA implementation is in place.
*/ */
async bulkCreate(users, options = {}) { async bulkCreate(users, options = {}) {
if (!users || !(Array.isArray(users) || users instanceof Collection)) { if (!users || !(Array.isArray(users) || users instanceof Collection)) {

View File

@@ -607,6 +607,7 @@ class GuildMemberManager extends CachedManager {
* console.log(`Banned ${result.bannedUsers.length} users, failed to ban ${result.failedUsers.length} users.`) * console.log(`Banned ${result.bannedUsers.length} users, failed to ban ${result.failedUsers.length} users.`)
* }) * })
* .catch(console.error); * .catch(console.error);
* @deprecated This method will not be usable until an effective MFA implementation is in place.
*/ */
bulkBan(users, options = {}) { bulkBan(users, options = {}) {
return this.guild.bans.bulkCreate(users, options); return this.guild.bans.bulkCreate(users, options);

3
typings/index.d.ts vendored
View File

@@ -776,6 +776,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
public fetchGuildWidget(guild: GuildResolvable): Promise<Widget>; public fetchGuildWidget(guild: GuildResolvable): Promise<Widget>;
public sleep(timeout: number): Promise<void>; public sleep(timeout: number): Promise<void>;
public login(token?: string): Promise<string>; public login(token?: string): Promise<string>;
/** @deprecated This method will not be updated until I find the most convenient way to implement MFA. */
public passLogin(email: string, password: string, code?: string | number): Promise<string | null>; public passLogin(email: string, password: string, code?: string | number): Promise<string | null>;
public QRLogin(): Promise<void>; public QRLogin(): Promise<void>;
public logout(): Promise<void>; public logout(): Promise<void>;
@@ -4320,6 +4321,7 @@ export class GuildMemberManager extends CachedManager<Snowflake, GuildMember, Gu
public search(options: GuildSearchMembersOptions): Promise<Collection<Snowflake, GuildMember>>; public search(options: GuildSearchMembersOptions): Promise<Collection<Snowflake, GuildMember>>;
public unban(user: UserResolvable, reason?: string): Promise<User | null>; public unban(user: UserResolvable, reason?: string): Promise<User | null>;
public fetchByMemberSafety(timeout?: number): Promise<Collection<Snowflake, GuildMember>>; public fetchByMemberSafety(timeout?: number): Promise<Collection<Snowflake, GuildMember>>;
/** @deprecated This method will not be usable until an effective MFA implementation is in place. */
public bulkBan( public bulkBan(
users: Collection<Snowflake, UserResolvable> | readonly UserResolvable[], users: Collection<Snowflake, UserResolvable> | readonly UserResolvable[],
options?: BulkBanOptions, options?: BulkBanOptions,
@@ -4333,6 +4335,7 @@ export class GuildBanManager extends CachedManager<Snowflake, GuildBan, GuildBan
public fetch(options: UserResolvable | FetchBanOptions): Promise<GuildBan>; public fetch(options: UserResolvable | FetchBanOptions): Promise<GuildBan>;
public fetch(options?: FetchBansOptions): Promise<Collection<Snowflake, GuildBan>>; public fetch(options?: FetchBansOptions): Promise<Collection<Snowflake, GuildBan>>;
public remove(user: UserResolvable, reason?: string): Promise<User | null>; public remove(user: UserResolvable, reason?: string): Promise<User | null>;
/** @deprecated This method will not be usable until an effective MFA implementation is in place. */
public bulkCreate( public bulkCreate(
users: Collection<Snowflake, UserResolvable> | readonly UserResolvable[], users: Collection<Snowflake, UserResolvable> | readonly UserResolvable[],
options?: BulkBanOptions, options?: BulkBanOptions,