Fix formatting (deno fmt)

This commit is contained in:
Exists
2021-04-14 13:09:47 -04:00
parent ce36477426
commit 215141171a
3 changed files with 19 additions and 19 deletions
+3 -3
View File
@@ -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<PermissionStrings> = 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);
@@ -57,7 +57,7 @@ export async function createChannel(
deny: calculateBits(perm.deny),
})),
type: options?.type || DiscordChannelTypes.GUILD_TEXT,
}
},
)) as DiscordChannel;
const discordenoChannel = await structures.createDiscordenoChannel(result);
+9 -9
View File
@@ -33,7 +33,7 @@ const baseChannel: Partial<DiscordenoChannel> = {
},
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<DiscordenoChannel> = {
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<DiscordenoChannel> = {
this.guildId!,
this.id!,
overwrites,
permissions
permissions,
);
},
edit(options, reason) {
@@ -79,7 +79,7 @@ const baseChannel: Partial<DiscordenoChannel> = {
// 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<Overwrite, "id">
options: Omit<Overwrite, "id">,
): ReturnType<typeof editChannelOverwrite>;
/** Delete a channel Overwrite */
deleteOverwrite(
overwriteID: string
overwriteID: string,
): ReturnType<typeof deleteChannelOverwrite>;
/** 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<typeof channelOverwriteHasPermission>;
/** Edit the channel */
edit(options: ModifyChannel, reason?: string): ReturnType<typeof editChannel>;
+3 -3
View File
@@ -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.",
);
}
},