From 215141171ae78971b9f30619000bf59b544ff68a Mon Sep 17 00:00:00 2001 From: Exists <55012346+existentiality@users.noreply.github.com> Date: Wed, 14 Apr 2021 13:09:47 -0400 Subject: [PATCH] Fix formatting (deno fmt) --- src/helpers/channels/create_channel.ts | 14 +++++++------- src/structures/channel.ts | 18 +++++++++--------- tests/channels/clone_channel.ts | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/helpers/channels/create_channel.ts b/src/helpers/channels/create_channel.ts index 180028d68..903103343 100644 --- a/src/helpers/channels/create_channel.ts +++ b/src/helpers/channels/create_channel.ts @@ -17,7 +17,7 @@ import { calculateBits } from "../../util/permissions.ts"; /** Create a channel in your server. Bot needs MANAGE_CHANNEL permissions in the server. */ export async function createChannel( guildId: string, - options?: CreateGuildChannel + options?: CreateGuildChannel, ) { const requiredPerms: Set = new Set(["MANAGE_CHANNELS"]); @@ -32,7 +32,7 @@ export async function createChannel( } eventHandlers.debug?.( "loop", - `Running forEach loop in create_channel file.` + `Running forEach loop in create_channel file.`, ); overwrite.allow.forEach(requiredPerms.add, requiredPerms); overwrite.deny.forEach(requiredPerms.add, requiredPerms); @@ -51,13 +51,13 @@ export async function createChannel( permission_overwrites: useDefaultOverwrites ? options?.permissionOverwrites : options?.permissionOverwrites?.map((perm) => ({ - ...perm, + ...perm, - allow: calculateBits(perm.allow), - deny: calculateBits(perm.deny), - })), + allow: calculateBits(perm.allow), + deny: calculateBits(perm.deny), + })), type: options?.type || DiscordChannelTypes.GUILD_TEXT, - } + }, )) as DiscordChannel; const discordenoChannel = await structures.createDiscordenoChannel(result); diff --git a/src/structures/channel.ts b/src/structures/channel.ts index 793a71e13..3e3d27329 100644 --- a/src/structures/channel.ts +++ b/src/structures/channel.ts @@ -33,7 +33,7 @@ const baseChannel: Partial = { }, get voiceStates() { return this.guild?.voiceStates.filter( - (voiceState) => voiceState.channelId === this.id + (voiceState) => voiceState.channelId === this.id, ); }, get connectedMembers() { @@ -41,7 +41,7 @@ const baseChannel: Partial = { if (!voiceStates) return undefined; return new Collection( - voiceStates.map((vs, key) => [key, cache.members.get(key)]) + voiceStates.map((vs, key) => [key, cache.members.get(key)]), ); }, send(content) { @@ -64,7 +64,7 @@ const baseChannel: Partial = { this.guildId!, this.id!, overwrites, - permissions + permissions, ); }, edit(options, reason) { @@ -79,7 +79,7 @@ const baseChannel: Partial = { // deno-lint-ignore require-await export async function createDiscordenoChannel( data: DiscordChannel, - guildId?: string + guildId?: string, ) { const { guildId: rawGuildId = "", @@ -91,7 +91,7 @@ export async function createDiscordenoChannel( Object.keys(rest).forEach((key) => { eventHandlers.debug?.( "loop", - `Running forEach loop in createDiscordenoChannel function.` + `Running forEach loop in createDiscordenoChannel function.`, ); // @ts-ignore index signature props[key] = createNewProp(rest[key]); @@ -101,7 +101,7 @@ export async function createDiscordenoChannel( ...props, guildId: createNewProp(guildId || rawGuildId), lastPinTimestamp: createNewProp( - lastPinTimestamp ? Date.parse(lastPinTimestamp) : undefined + lastPinTimestamp ? Date.parse(lastPinTimestamp) : undefined, ), }); @@ -152,16 +152,16 @@ export interface DiscordenoChannel /** Edit a channel Overwrite */ editOverwrite( overwriteID: string, - options: Omit + options: Omit, ): ReturnType; /** Delete a channel Overwrite */ deleteOverwrite( - overwriteID: string + overwriteID: string, ): ReturnType; /** Checks if a channel overwrite for a user id or a role id has permission in this channel */ hasPermission( overwrites: DiscordOverwrite[], - permissions: PermissionStrings[] + permissions: PermissionStrings[], ): ReturnType; /** Edit the channel */ edit(options: ModifyChannel, reason?: string): ReturnType; diff --git a/tests/channels/clone_channel.ts b/tests/channels/clone_channel.ts index bb2209acb..caddad7d4 100644 --- a/tests/channels/clone_channel.ts +++ b/tests/channels/clone_channel.ts @@ -25,13 +25,13 @@ Deno.test({ if (originalChannel.topic && cloned.topic !== originalChannel.topic) { throw new Error( - "The clone was supposed to have a topic but it does not appear to be the same topic." + "The clone was supposed to have a topic but it does not appear to be the same topic.", ); } if (originalChannel.bitrate && cloned.bitrate !== originalChannel.bitrate) { throw new Error( - "The clone was supposed to have a bitrate but it does not appear to be the same bitrate." + "The clone was supposed to have a bitrate but it does not appear to be the same bitrate.", ); } @@ -41,7 +41,7 @@ Deno.test({ originalChannel.permissionOverwrites.length ) { throw new Error( - "The clone was supposed to have a permissionOverwrites but it does not appear to be the same permissionOverwrites." + "The clone was supposed to have a permissionOverwrites but it does not appear to be the same permissionOverwrites.", ); } },