diff --git a/src/client/BaseClient.ts b/src/client/BaseClient.ts index 44a9e90..8c55986 100644 --- a/src/client/BaseClient.ts +++ b/src/client/BaseClient.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-explicit-any -import { EventEmitter, REST, RESTOptions, deepMerge } from '../../deps.ts'; +import { deepMerge, EventEmitter, REST, RESTOptions } from '../../deps.ts'; import { Client } from './mod.ts'; import type { Channel, @@ -88,16 +88,17 @@ export interface BaseClientOptions { } // deno-lint-ignore ban-types -type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; +type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial } + : T; export abstract class BaseClient extends EventEmitter { readonly api: REST; #token: string | null = null; - options: BaseClientOptions + options: BaseClientOptions; bot = true; constructor(opts: DeepPartial = {}) { super(); - this.options = deepMerge(DEFAULT_CLIENT_OPTIONS, opts) as BaseClientOptions + this.options = deepMerge(DEFAULT_CLIENT_OPTIONS, opts) as BaseClientOptions; this.api = new REST(this.options.rest); this.api.debug = (msg: string) => this.emit(Events.DEBUG, `[HTTP]: ${msg}`); } diff --git a/src/client/actions/Action.ts b/src/client/actions/Action.ts index 3ceb090..e1ce788 100644 --- a/src/client/actions/Action.ts +++ b/src/client/actions/Action.ts @@ -5,5 +5,5 @@ export abstract class Action { abstract handle(data: unknown): Awaited; } -export { Events } from '../../util/Constants.ts' -export type { API } from '../../../deps.ts' +export { Events } from '../../util/Constants.ts'; +export type { API } from '../../../deps.ts'; diff --git a/src/client/actions/ChannelCreate.ts b/src/client/actions/ChannelCreate.ts index 54dbd25..1b8c0e0 100644 --- a/src/client/actions/ChannelCreate.ts +++ b/src/client/actions/ChannelCreate.ts @@ -1,4 +1,4 @@ -import { Action, Events, API } from './Action.ts'; +import { Action, API, Events } from './Action.ts'; export class ChannelCreateAction extends Action { async handle(data: API.Channel): Promise { diff --git a/src/client/actions/ChannelUpdate.ts b/src/client/actions/ChannelUpdate.ts index f357b5a..d8dc33a 100644 --- a/src/client/actions/ChannelUpdate.ts +++ b/src/client/actions/ChannelUpdate.ts @@ -1,4 +1,4 @@ -import { Action, Events, API } from './Action.ts'; +import { Action, API, Events } from './Action.ts'; export class ChannelUpdateAction extends Action { handle( diff --git a/src/client/actions/Message.ts b/src/client/actions/Message.ts index 3c89f65..cd68ce9 100644 --- a/src/client/actions/Message.ts +++ b/src/client/actions/Message.ts @@ -1,4 +1,4 @@ -import { Action, Events, API } from './Action.ts'; +import { Action, API, Events } from './Action.ts'; import { SYSTEM_USER_ID } from '../../util/Constants.ts'; export class MessageAction extends Action { diff --git a/src/client/actions/MessageUpdate.ts b/src/client/actions/MessageUpdate.ts index 023229b..8b7e4d4 100644 --- a/src/client/actions/MessageUpdate.ts +++ b/src/client/actions/MessageUpdate.ts @@ -1,4 +1,4 @@ -import { Action, Events, API} from './Action.ts'; +import { Action, API, Events } from './Action.ts'; export class MessageUpdateAction extends Action { handle(data: { id: string; channel: string; data: API.Message }): void { diff --git a/src/client/actions/ServerCreate.ts b/src/client/actions/ServerCreate.ts index b1e97b7..df803bd 100644 --- a/src/client/actions/ServerCreate.ts +++ b/src/client/actions/ServerCreate.ts @@ -1,13 +1,13 @@ -import { Action, Events, API } from './Action.ts' +import { Action, API, Events } from './Action.ts'; export class ServerCreateAction extends Action { async handle(data: API.Server): Promise { - const server = this.client.servers._add(data) + const server = this.client.servers._add(data); if (this.client.options.fetchMembers) { - await server.members.fetch() + await server.members.fetch(); } - this.client.emit(Events.SERVER_CREATE, server) + this.client.emit(Events.SERVER_CREATE, server); } } diff --git a/src/client/actions/ServerDelete.ts b/src/client/actions/ServerDelete.ts index 2cc3f2d..f10579e 100644 --- a/src/client/actions/ServerDelete.ts +++ b/src/client/actions/ServerDelete.ts @@ -1,4 +1,4 @@ -import { Action, Events, API } from './Action.ts'; +import { Action, API, Events } from './Action.ts'; export class ServerDeleteAction extends Action { handle(data: API.Server): unknown { diff --git a/src/client/actions/ServerMemberUpdate.ts b/src/client/actions/ServerMemberUpdate.ts index bf3caa9..7c9b27e 100644 --- a/src/client/actions/ServerMemberUpdate.ts +++ b/src/client/actions/ServerMemberUpdate.ts @@ -1,4 +1,4 @@ -import { Action, Events, API } from './Action.ts'; +import { Action, API, Events } from './Action.ts'; export class ServerMemberUpdateAction extends Action { handle(data: { id: string; data: API.Member }): void { diff --git a/src/client/actions/ServerRoleUpdate.ts b/src/client/actions/ServerRoleUpdate.ts index 25b43b8..4073f89 100644 --- a/src/client/actions/ServerRoleUpdate.ts +++ b/src/client/actions/ServerRoleUpdate.ts @@ -1,4 +1,4 @@ -import { Action, Events, API } from './Action.ts'; +import { Action, API, Events } from './Action.ts'; export class ServerRoleUpdateAction extends Action { handle( diff --git a/src/client/actions/ServerUpdate.ts b/src/client/actions/ServerUpdate.ts index 625dcc1..d1cc174 100644 --- a/src/client/actions/ServerUpdate.ts +++ b/src/client/actions/ServerUpdate.ts @@ -1,4 +1,4 @@ -import { Action, Events, API } from './Action.ts'; +import { Action, API, Events } from './Action.ts'; export class ServerUpdateAction extends Action { handle( diff --git a/src/client/actions/UserUpdate.ts b/src/client/actions/UserUpdate.ts index 3e25436..f91ac82 100644 --- a/src/client/actions/UserUpdate.ts +++ b/src/client/actions/UserUpdate.ts @@ -1,4 +1,4 @@ -import { Action, Events, API } from './Action.ts'; +import { Action, API, Events } from './Action.ts'; export class UserUpdateAction extends Action { handle(data: { id: string; data: API.User; clear: API.FieldsUser[] }): void { diff --git a/src/client/actions/mod.ts b/src/client/actions/mod.ts index a89c6da..0ff9c20 100644 --- a/src/client/actions/mod.ts +++ b/src/client/actions/mod.ts @@ -8,7 +8,7 @@ export * from './ChannelStopTyping.ts'; export * from './Message.ts'; export * from './MessageDelete.ts'; export * from './MessageUpdate.ts'; -export * from './ServerCreate.ts' +export * from './ServerCreate.ts'; export * from './ServerDelete.ts'; export * from './ServerMemberJoin.ts'; export * from './ServerMemberLeave.ts'; diff --git a/src/structures/ClientUser.ts b/src/structures/ClientUser.ts index a1c3041..638950c 100644 --- a/src/structures/ClientUser.ts +++ b/src/structures/ClientUser.ts @@ -1,4 +1,4 @@ -import { User } from './User.ts' +import { User } from './User.ts'; import { NotesChannel, Status } from './mod.ts'; export class ClientUser extends User { diff --git a/src/util/Constants.ts b/src/util/Constants.ts index cbfd407..af6e9e2 100644 --- a/src/util/Constants.ts +++ b/src/util/Constants.ts @@ -81,7 +81,7 @@ export const DEFAULT_CLIENT_OPTIONS: BaseClientOptions = { }, ws: { heartbeat: 30_000, - reconnect: true + reconnect: true, }, } as const;