From 0edc74b1db8cb4cba56f588dc87e5c35bab08687 Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Mon, 25 Jan 2021 18:56:32 +0530 Subject: [PATCH] fix --- src/structures/textChannel.ts | 6 +++--- src/types/channel.ts | 2 +- src/utils/snowflake.ts | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/structures/textChannel.ts b/src/structures/textChannel.ts index 062a1ed..5350479 100644 --- a/src/structures/textChannel.ts +++ b/src/structures/textChannel.ts @@ -232,7 +232,7 @@ export class TextChannel extends Channel { /** Trigger the typing indicator. NOT recommended to be used by bots unless you really want to. */ async triggerTyping(): Promise { - await this.client.rest.api.channels[this.id].typing.psot() + await this.client.rest.api.channels[this.id].typing.post() return this } } @@ -294,7 +294,7 @@ export class GuildTextChannel extends TextChannel { parent_id: options?.parentID, nsfw: options?.nsfw, topic: options?.topic, - rate_limit_per_user: options?.rateLimitPerUser + rate_limit_per_user: options?.slowmode } const resp = await this.client.rest.patch(CHANNEL(this.id), body) @@ -419,7 +419,7 @@ export class GuildTextChannel extends TextChannel { /** Edit Slowmode of the channel */ async setSlowmode(slowmode?: number | null): Promise { - return await this.edit({ rateLimitPerUser: slowmode ?? null }) + return await this.edit({ slowmode: slowmode ?? null }) } /** Edit NSFW property of the channel */ diff --git a/src/types/channel.ts b/src/types/channel.ts index 77ee75d..25606a0 100644 --- a/src/types/channel.ts +++ b/src/types/channel.ts @@ -97,7 +97,7 @@ export interface ModifyGuildTextChannelOption extends ModifyChannelOption { type?: number topic?: string | null nsfw?: boolean | null - rateLimitPerUser?: number | null + slowmode?: number | null } export interface ModifyGuildNewsChannelOption extends ModifyChannelOption { diff --git a/src/utils/snowflake.ts b/src/utils/snowflake.ts index 61de221..9af3060 100644 --- a/src/utils/snowflake.ts +++ b/src/utils/snowflake.ts @@ -11,19 +11,19 @@ export class Snowflake { } get timestamp(): number { - return Number(((this.snowflake >> 22n) + 1420070400000n).toString()) + return Number((this.snowflake >> 22n) + 1420070400000n) } get workerID(): number { - return Number(((this.snowflake & 0x3e0000n) >> 17n).toString()) + return Number((this.snowflake & 0x3e0000n) >> 17n) } get processID(): number { - return Number(((this.snowflake & 0x1f00n) >> 12n).toString()) + return Number((this.snowflake & 0x1f00n) >> 12n) } get increment(): number { - return Number((this.snowflake & 0xfffn).toString()) + return Number(this.snowflake & 0xfffn) } get toString(): string {