From 4428330c07a4512744ba0b4e7d1c4cc0d5b12fad Mon Sep 17 00:00:00 2001 From: MARCROCK22 <57925328+MARCROCK22@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:17:44 -0400 Subject: [PATCH] fix: socram code --- src/common/shorters/users.ts | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/common/shorters/users.ts b/src/common/shorters/users.ts index 9a3ea7b..6e30316 100644 --- a/src/common/shorters/users.ts +++ b/src/common/shorters/users.ts @@ -35,38 +35,4 @@ export class UsersShorter extends BaseShorter { async write(userId: string, body: MessageCreateBodyRequest) { return (await this.client.users.createDM(userId)).messages.write(body); } - - get users() { - return { - createDM: async (userId: string, force = false) => { - if (!force) { - const dm = await this.client.cache.channels?.get(userId); - if (dm) return dm as DMChannel; - } - const data = await this.client.proxy.users('@me').channels.post({ - body: { recipient_id: userId }, - }); - await this.client.cache.channels?.set(userId, '@me', data); - return new DMChannel(this.client, data); - }, - deleteDM: async (userId: string, reason?: string) => { - const res = await this.client.proxy.channels(userId).delete({ reason }); - await this.client.cache.channels?.removeIfNI(BaseChannel.__intent__('@me'), res.id, '@me'); - return new DMChannel(this.client, res); - }, - fetch: async (userId: string, force = false) => { - if (!force) { - const user = await this.client.cache.users?.get(userId); - if (user) return user; - } - - const data = await this.client.proxy.users(userId).get(); - await this.client.cache.users?.patch(userId, data); - return new User(this.client, data); - }, - write: async (userId: string, body: MessageCreateBodyRequest) => { - return (await this.client.users.createDM(userId)).messages.write(body); - }, - }; - } }