Merge pull request #59 from hongduccodedao/main

Fix Reddem
This commit is contained in:
March 7th 2022-04-25 22:46:13 +07:00 committed by GitHub
commit d7bdeba3d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -17,9 +17,9 @@ new Client({
```js ```js
client.updateCookie(): Promise<void> client.updateCookie(): Promise<void>
``` ```
- Reddem Nitro - Redeem Nitro
```js ```js
client.reddemNitro('code'): Promise<void> client.redeemNitro('code'): Promise<void>
``` ```
## Sync Status ## Sync Status

View File

@ -295,7 +295,7 @@ await client.user.setPassword('old password', 'new password');
await client.user.disableAccount('password'); await client.user.disableAccount('password');
// Delete Account [WARNING] Cannot be changed once used! // Delete Account [WARNING] Cannot be changed once used!
await client.user.deleteAccount('password'); await client.user.deleteAccount('password');
// Reddem Nitro // Redeem Nitro
await client.reddemNitro('code') await client.redeemNitro('code')
``` ```
</details> </details>

View File

@ -377,7 +377,7 @@ class Client extends BaseClient {
* discordapp.com/gifts/code | discord.gift/code * discordapp.com/gifts/code | discord.gift/code
* @returns {Promise} * @returns {Promise}
*/ */
async reddemNitro(nitro) { async redeemNitro(nitro) {
if (typeof nitro !== 'string') throw new Error('INVALID_NITRO'); if (typeof nitro !== 'string') throw new Error('INVALID_NITRO');
const regexNitro = /discord(?:(?:app)?\.com\/gifts|\.gift)\/([\w-]{2,255})/gi; const regexNitro = /discord(?:(?:app)?\.com\/gifts|\.gift)\/([\w-]{2,255})/gi;
const code = DataResolver.resolveCode(nitro, regexNitro); const code = DataResolver.resolveCode(nitro, regexNitro);

2
typings/index.d.ts vendored
View File

@ -582,7 +582,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
public fetchPremiumStickerPacks(): Promise<Collection<Snowflake, StickerPack>>; public fetchPremiumStickerPacks(): Promise<Collection<Snowflake, StickerPack>>;
public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>; public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
public fetchGuildWidget(guild: GuildResolvable): Promise<Widget>; public fetchGuildWidget(guild: GuildResolvable): Promise<Widget>;
public reddemNitro(code: String<NitroCode>): Promise; public redeemNitro(code: String<NitroCode>): Promise;
public generateInvite(options?: InviteGenerationOptions): string; public generateInvite(options?: InviteGenerationOptions): string;
public login(token?: string): Promise<string>; public login(token?: string): Promise<string>;
public isReady(): this is Client<true>; public isReady(): this is Client<true>;