diff --git "a/src/api/routes/channels/\043channel_id/permissions.ts" "b/src/api/routes/channels/\043channel_id/permissions.ts" index e0feb3f..c80d9a1 100644 --- "a/src/api/routes/channels/\043channel_id/permissions.ts" +++ "b/src/api/routes/channels/\043channel_id/permissions.ts" @@ -21,7 +21,7 @@ import { HTTPError } from "lambert-server"; import { route } from "@spacebar/api"; -import { ChannelPermissionOverwriteSchema, ChannelPermissionOverwrite, ChannelPermissionOverwriteType } from "@spacebar/schemas" +import { ChannelPermissionOverwriteSchema, ChannelPermissionOverwrite, ChannelPermissionOverwriteType } from "@spacebar/schemas"; const router: Router = Router({ mergeParams: true }); // TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel) diff --git "a/src/api/routes/channels/\043channel_id/pins.ts" "b/src/api/routes/channels/\043channel_id/pins.ts" index a5aecda..4b62115 100644 --- "a/src/api/routes/channels/\043channel_id/pins.ts" +++ "b/src/api/routes/channels/\043channel_id/pins.ts" @@ -17,16 +17,7 @@ */ import { route } from "@spacebar/api"; -import { - ChannelPinsUpdateEvent, - Config, - DiscordApiErrors, - emitEvent, - Message, - MessageCreateEvent, - MessageUpdateEvent, - User, -} from "@spacebar/util"; +import { ChannelPinsUpdateEvent, Config, DiscordApiErrors, emitEvent, Message, MessageCreateEvent, MessageUpdateEvent, User } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { IsNull, Not } from "typeorm"; @@ -62,8 +53,7 @@ }); const { maxPins } = Config.get().limits.channel; - if (pinned_count >= maxPins) - throw DiscordApiErrors.MAXIMUM_PINS.withParams(maxPins); + if (pinned_count >= maxPins) throw DiscordApiErrors.MAXIMUM_PINS.withParams(maxPins); message.pinned_at = new Date(); diff --git "a/src/api/routes/channels/\043channel_id/purge.ts" "b/src/api/routes/channels/\043channel_id/purge.ts" index c8a2efa..9686bc2 100644 --- "a/src/api/routes/channels/\043channel_id/purge.ts" +++ "b/src/api/routes/channels/\043channel_id/purge.ts" @@ -17,14 +17,7 @@ */ import { route } from "@spacebar/api"; -import { - Channel, - Message, - MessageDeleteBulkEvent, - emitEvent, - getPermission, - getRights, -} from "@spacebar/util"; +import { Channel, Message, MessageDeleteBulkEvent, emitEvent, getPermission, getRights } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; import { Between, FindManyOptions, FindOperator, Not } from "typeorm"; @@ -56,17 +49,12 @@ where: { id: channel_id }, }); - if (!channel.guild_id) - throw new HTTPError("Can't purge dm channels", 400); + if (!channel.guild_id) throw new HTTPError("Can't purge dm channels", 400); isTextChannel(channel.type); const rights = await getRights(req.user_id); if (!rights.has("MANAGE_MESSAGES")) { - const permissions = await getPermission( - req.user_id, - channel.guild_id, - channel_id, - ); + const permissions = await getPermission(req.user_id, channel.guild_id, channel_id); permissions.hasThrow("MANAGE_MESSAGES"); permissions.hasThrow("MANAGE_CHANNELS"); } @@ -83,21 +71,10 @@ where: { channel_id, id: Between(after, before), // the right way around - author_id: rights.has("SELF_DELETE_MESSAGES") - ? undefined - : Not(req.user_id), + author_id: rights.has("SELF_DELETE_MESSAGES") ? undefined : Not(req.user_id), // if you lack the right of self-deletion, you can't delete your own messages, even in purges }, - relations: [ - "author", - "webhook", - "application", - "mentions", - "mention_roles", - "mention_channels", - "sticker_items", - "attachments", - ], + relations: ["author", "webhook", "application", "mentions", "mention_roles", "mention_channels", "sticker_items", "attachments"], }; const messages = await Message.find(query); diff --git "a/src/api/routes/channels/\043channel_id/webhooks.ts" "b/src/api/routes/channels/\043channel_id/webhooks.ts" index cddff71..106d844 100644 --- "a/src/api/routes/channels/\043channel_id/webhooks.ts" +++ "b/src/api/routes/channels/\043channel_id/webhooks.ts" @@ -17,16 +17,7 @@ */ import { route } from "@spacebar/api"; -import { - Channel, - Config, - DiscordApiErrors, - User, - Webhook, - handleFile, - trimSpecial, - ValidateName, -} from "@spacebar/util"; +import { Channel, Config, DiscordApiErrors, User, Webhook, handleFile, trimSpecial, ValidateName } from "@spacebar/util"; import crypto from "crypto"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; @@ -37,8 +28,7 @@ router.get( "/", route({ - description: - "Returns a list of channel webhook objects. Requires the MANAGE_WEBHOOKS permission.", + description: "Returns a list of channel webhook objects. Requires the MANAGE_WEBHOOKS permission.", permission: "MANAGE_WEBHOOKS", responses: { 200: { @@ -50,27 +40,14 @@ const { channel_id } = req.params; const webhooks = await Webhook.find({ where: { channel_id }, - relations: [ - "user", - "channel", - "source_channel", - "guild", - "source_guild", - "application", - ], + relations: ["user", "channel", "source_channel", "guild", "source_guild", "application"], }); - const instanceUrl = - Config.get().api.endpointPublic || "http://localhost:3001"; + const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001"; return res.json( webhooks.map((webhook) => ({ ...webhook, - url: - instanceUrl + - "/webhooks/" + - webhook.id + - "/" + - webhook.token, + url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, })), ); }, @@ -103,8 +80,7 @@ const webhook_count = await Webhook.count({ where: { channel_id } }); const { maxWebhooks } = Config.get().limits.channel; - if (maxWebhooks && webhook_count > maxWebhooks) - throw DiscordApiErrors.MAXIMUM_WEBHOOKS.withParams(maxWebhooks); + if (maxWebhooks && webhook_count > maxWebhooks) throw DiscordApiErrors.MAXIMUM_WEBHOOKS.withParams(maxWebhooks); let { avatar, name } = req.body as WebhookCreateSchema; name = trimSpecial(name); diff --git a/src/api/routes/channels/preload-messages.ts b/src/api/routes/channels/preload-messages.ts index 4779570..cdfc58f 100644 --- a/src/api/routes/channels/preload-messages.ts +++ b/src/api/routes/channels/preload-messages.ts @@ -19,7 +19,7 @@ import { route } from "@spacebar/api"; import { Config, Message } from "@spacebar/util"; import { Request, Response, Router } from "express"; -import { PreloadMessagesRequestSchema, PreloadMessagesResponseSchema } from "@spacebar/schemas" +import { PreloadMessagesRequestSchema, PreloadMessagesResponseSchema } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); router.post( diff --git a/src/schemas/Identifiers.ts b/src/schemas/Identifiers.ts index 5b462c1..ffdc456 100644 --- a/src/schemas/Identifiers.ts +++ b/src/schemas/Identifiers.ts @@ -26,4 +26,4 @@ * number of ms since Discord epoch worker pid increment * ``` */ -export type Snowflake = string; \ No newline at end of file +export type Snowflake = string; diff --git a/src/schemas/api/channels/Webhook.ts b/src/schemas/api/channels/Webhook.ts index 7f200ec..510916c 100644 --- a/src/schemas/api/channels/Webhook.ts +++ b/src/schemas/api/channels/Webhook.ts @@ -2,4 +2,4 @@ Incoming = 1, ChannelFollower = 2, Application = 3, -} \ No newline at end of file +} diff --git a/src/schemas/api/developers/Team.ts b/src/schemas/api/developers/Team.ts index 94ddb8a..131e9fb 100644 --- a/src/schemas/api/developers/Team.ts +++ b/src/schemas/api/developers/Team.ts @@ -6,4 +6,4 @@ ADMIN = "admin", DEVELOPER = "developer", READ_ONLY = "read_only", -} \ No newline at end of file +} diff --git a/src/schemas/api/guilds/Automod.ts b/src/schemas/api/guilds/Automod.ts index 473d988..e7c3ab9 100644 --- a/src/schemas/api/guilds/Automod.ts +++ b/src/schemas/api/guilds/Automod.ts @@ -62,33 +62,35 @@ BLOCK_MESSAGE = 1, SEND_ALERT_MESSAGE = 2, TIMEOUT_USER = 3, - QUARANTINE_USER = 4 + QUARANTINE_USER = 4, } -export type AutomodAction = { - type: AutomodRuleActionType.BLOCK_MESSAGE; - metadata: { - custom_message?: string; - } -} | { - type: AutomodRuleActionType.SEND_ALERT_MESSAGE; - metadata: { - channel_id: Snowflake; - }; -} | { - type: AutomodRuleActionType.TIMEOUT_USER; - metadata: { - duration_seconds: number; - }; -} | { - type: AutomodRuleActionType.QUARANTINE_USER; - metadata: { - duration_seconds: number; - }; -}; +export type AutomodAction = + | { + type: AutomodRuleActionType.BLOCK_MESSAGE; + metadata: { + custom_message?: string; + }; + } + | { + type: AutomodRuleActionType.SEND_ALERT_MESSAGE; + metadata: { + channel_id: Snowflake; + }; + } + | { + type: AutomodRuleActionType.TIMEOUT_USER; + metadata: { + duration_seconds: number; + }; + } + | { + type: AutomodRuleActionType.QUARANTINE_USER; + metadata: { + duration_seconds: number; + }; + }; // TODO // eslint-disable-next-line -export interface AutomodRuleActionMetadata { - -} \ No newline at end of file +export interface AutomodRuleActionMetadata {} diff --git a/src/schemas/api/guilds/GuildProfileResponse.ts b/src/schemas/api/guilds/GuildProfileResponse.ts index 58e4b48..703967c 100644 --- a/src/schemas/api/guilds/GuildProfileResponse.ts +++ b/src/schemas/api/guilds/GuildProfileResponse.ts @@ -26,7 +26,7 @@ brand_color_primary: string; banner_hash: string | null; game_application_ids: string[]; - game_activity: {[id: string]: GameActivity}; + game_activity: { [id: string]: GameActivity }; tag: string | null; badge: GuildBadgeType; badge_color_primary: string; @@ -57,7 +57,7 @@ export enum GuildVisibilityLevel { PUBLIC = 1, RESTRICTED = 2, - PUBLIC_WITH_RECRUITMENT = 3 + PUBLIC_WITH_RECRUITMENT = 3, } export enum GuildBadgeType { @@ -93,4 +93,3 @@ MONEY_BAG = 29, DOLLAR_SIGN = 30, } - diff --git a/src/schemas/api/guilds/Role.ts b/src/schemas/api/guilds/Role.ts index 3775b31..f9b0100 100644 --- a/src/schemas/api/guilds/Role.ts +++ b/src/schemas/api/guilds/Role.ts @@ -10,4 +10,4 @@ tertiary_color: this.tertiary_color ?? undefined, }; } -} \ No newline at end of file +} diff --git a/src/schemas/api/guilds/VoiceState.ts b/src/schemas/api/guilds/VoiceState.ts index 1c8d222..b2275c7 100644 --- a/src/schemas/api/guilds/VoiceState.ts +++ b/src/schemas/api/guilds/VoiceState.ts @@ -17,8 +17,6 @@ export type PublicVoiceStateKeys = keyof typeof PublicVoiceStateEnum; -export const PublicVoiceStateProjection = Object.values( - PublicVoiceStateEnum, -).filter((x) => typeof x === "string") as PublicVoiceStateKeys[]; +export const PublicVoiceStateProjection = Object.values(PublicVoiceStateEnum).filter((x) => typeof x === "string") as PublicVoiceStateKeys[]; export type PublicVoiceState = Pick; diff --git a/src/schemas/api/messages/Components.ts b/src/schemas/api/messages/Components.ts index 1415dea..96929ac 100644 --- a/src/schemas/api/messages/Components.ts +++ b/src/schemas/api/messages/Components.ts @@ -24,12 +24,7 @@ export interface ActionRowComponent extends MessageComponent { type: MessageComponentType.ActionRow; - components: ( - | ButtonComponent - | StringSelectMenuComponent - | SelectMenuComponent - | TextInputComponent - )[]; + components: (ButtonComponent | StringSelectMenuComponent | SelectMenuComponent | TextInputComponent)[]; } export interface ButtonComponent extends MessageComponent { @@ -113,4 +108,4 @@ RoleSelect = 6, MentionableSelect = 7, ChannelSelect = 8, -} \ No newline at end of file +} diff --git a/src/schemas/api/messages/Message.ts b/src/schemas/api/messages/Message.ts index 485e864..30eccc7 100644 --- a/src/schemas/api/messages/Message.ts +++ b/src/schemas/api/messages/Message.ts @@ -46,7 +46,6 @@ UNHANDLED = 255, } - /** * https://docs.discord.food/resources/message#partial-message-structure */ diff --git a/src/schemas/api/messages/Polls.ts b/src/schemas/api/messages/Polls.ts index c75717d..d642388 100644 --- a/src/schemas/api/messages/Polls.ts +++ b/src/schemas/api/messages/Polls.ts @@ -16,7 +16,7 @@ along with this program. If not, see . */ -import { PartialEmoji } from "@spacebar/schemas" +import { PartialEmoji } from "@spacebar/schemas"; export interface Poll { question: PollMedia; diff --git a/src/schemas/api/users/ConnectedAccount.ts b/src/schemas/api/users/ConnectedAccount.ts index 66c9aea..a623034 100644 --- a/src/schemas/api/users/ConnectedAccount.ts +++ b/src/schemas/api/users/ConnectedAccount.ts @@ -1,6 +1,3 @@ import { ConnectedAccount } from "@spacebar/util"; -export type PublicConnectedAccount = Pick< - ConnectedAccount, - "name" | "type" | "verified" ->; \ No newline at end of file +export type PublicConnectedAccount = Pick; diff --git a/src/schemas/api/users/Member.ts b/src/schemas/api/users/Member.ts index 1acd441..025e4e1 100644 --- a/src/schemas/api/users/Member.ts +++ b/src/schemas/api/users/Member.ts @@ -92,4 +92,4 @@ export type PublicMember = Omit, "roles"> & { user: PublicUser; roles: string[]; // only role ids not objects -}; \ No newline at end of file +}; diff --git a/src/schemas/api/users/SessionsSchemas.ts b/src/schemas/api/users/SessionsSchemas.ts index 583b349..b7c509b 100644 --- a/src/schemas/api/users/SessionsSchemas.ts +++ b/src/schemas/api/users/SessionsSchemas.ts @@ -20,7 +20,7 @@ import { ClientStatus } from "@spacebar/util"; export type SessionsLogoutSchema = { session_ids?: Snowflake[]; session_id_hashes?: string[] }; -export type GetSessionsResponse = { user_sessions: DeviceInfo[]; }; +export type GetSessionsResponse = { user_sessions: DeviceInfo[] }; export type DeviceInfo = { id: string; @@ -38,4 +38,4 @@ last_seen?: Date; last_seen_ip?: string; last_seen_location?: string; -}; \ No newline at end of file +}; diff --git a/src/schemas/api/users/index.ts b/src/schemas/api/users/index.ts index 5c50712..6400f42 100644 --- a/src/schemas/api/users/index.ts +++ b/src/schemas/api/users/index.ts @@ -19,4 +19,4 @@ export * from "./InstanceUserDeleteSchema"; export * from "./Member"; export * from "./User"; -export * from "./UserSettings"; \ No newline at end of file +export * from "./UserSettings"; diff --git a/src/schemas/responses/APIErrorOrCaptchaResponse.ts b/src/schemas/responses/APIErrorOrCaptchaResponse.ts index fd89a47..be9becd 100644 --- a/src/schemas/responses/APIErrorOrCaptchaResponse.ts +++ b/src/schemas/responses/APIErrorOrCaptchaResponse.ts @@ -19,6 +19,4 @@ import { APIErrorResponse } from "./APIErrorResponse"; import { CaptchaRequiredResponse } from "./CaptchaRequiredResponse"; -export type APIErrorOrCaptchaResponse = - | CaptchaRequiredResponse - | APIErrorResponse; +export type APIErrorOrCaptchaResponse = CaptchaRequiredResponse | APIErrorResponse; diff --git a/src/schemas/responses/AccountStandingResponse.ts b/src/schemas/responses/AccountStandingResponse.ts index b2992c7..ea345be 100644 --- a/src/schemas/responses/AccountStandingResponse.ts +++ b/src/schemas/responses/AccountStandingResponse.ts @@ -132,7 +132,7 @@ export enum GuildMemberType { OWNER = 1, - MEMBER = 2 + MEMBER = 2, } export interface GuildMetadata { diff --git a/src/schemas/responses/DmMessagesResponseSchema.ts b/src/schemas/responses/DmMessagesResponseSchema.ts index 62347ef..c6f9b13 100644 --- a/src/schemas/responses/DmMessagesResponseSchema.ts +++ b/src/schemas/responses/DmMessagesResponseSchema.ts @@ -16,6 +16,6 @@ along with this program. If not, see . */ -import { PartialMessage } from "@spacebar/schemas" +import { PartialMessage } from "@spacebar/schemas"; export type DmMessagesResponseSchema = PartialMessage[]; diff --git a/src/schemas/responses/GuildCreateResponse.ts b/src/schemas/responses/GuildCreateResponse.ts index 79331d2..afbf73c 100644 --- a/src/schemas/responses/GuildCreateResponse.ts +++ b/src/schemas/responses/GuildCreateResponse.ts @@ -17,7 +17,7 @@ */ import { GuildWelcomeScreen } from "@spacebar/util"; -import { GuildUpdateSchema } from "@spacebar/schemas" +import { GuildUpdateSchema } from "@spacebar/schemas"; export interface GuildCreateResponse extends Omit { id: string; diff --git a/src/schemas/responses/GuildMessagesSearchResponse.ts b/src/schemas/responses/GuildMessagesSearchResponse.ts index 9e7da5e..cf59786 100644 --- a/src/schemas/responses/GuildMessagesSearchResponse.ts +++ b/src/schemas/responses/GuildMessagesSearchResponse.ts @@ -16,10 +16,7 @@ along with this program. If not, see . */ -import { - Attachment, - Role, -} from "../../util/entities"; +import { Attachment, Role } from "../../util/entities"; import { ActionRowComponent, Embed, MessageType, Poll, PublicUser } from "@spacebar/schemas"; export interface GuildMessagesSearchMessage { diff --git a/src/schemas/responses/GuildVanityUrl.ts b/src/schemas/responses/GuildVanityUrl.ts index c6595a6..c96049f 100644 --- a/src/schemas/responses/GuildVanityUrl.ts +++ b/src/schemas/responses/GuildVanityUrl.ts @@ -25,10 +25,7 @@ code: null; } -export type GuildVanityUrlResponse = - | GuildVanityUrl - | GuildVanityUrl[] - | GuildVanityUrlNoInvite; +export type GuildVanityUrlResponse = GuildVanityUrl | GuildVanityUrl[] | GuildVanityUrlNoInvite; export interface GuildVanityUrlCreateResponse { code: string; diff --git a/src/schemas/responses/MemberJoinGuildResponse.ts b/src/schemas/responses/MemberJoinGuildResponse.ts index 1ef78ea..adef59c 100644 --- a/src/schemas/responses/MemberJoinGuildResponse.ts +++ b/src/schemas/responses/MemberJoinGuildResponse.ts @@ -17,7 +17,7 @@ */ import { Emoji, Role, Sticker } from "../../util/entities"; -import { GuildCreateResponse } from "@spacebar/schemas" +import { GuildCreateResponse } from "@spacebar/schemas"; export interface MemberJoinGuildResponse { guild: GuildCreateResponse; diff --git a/src/schemas/responses/PreloadMessagesResponseSchema.ts b/src/schemas/responses/PreloadMessagesResponseSchema.ts index 9452896..0edb6a7 100644 --- a/src/schemas/responses/PreloadMessagesResponseSchema.ts +++ b/src/schemas/responses/PreloadMessagesResponseSchema.ts @@ -18,4 +18,4 @@ import { Message } from "@spacebar/util"; -export type PreloadMessagesResponseSchema = Message[]; \ No newline at end of file +export type PreloadMessagesResponseSchema = Message[]; diff --git a/src/schemas/responses/UploadAttachmentResponseSchema.ts b/src/schemas/responses/UploadAttachmentResponseSchema.ts index eab5f22..7d32ead 100644 --- a/src/schemas/responses/UploadAttachmentResponseSchema.ts +++ b/src/schemas/responses/UploadAttachmentResponseSchema.ts @@ -16,7 +16,6 @@ along with this program. If not, see . */ - export interface UploadAttachmentResponseSchema { attachments: UploadAttachmentResponse[]; } diff --git a/src/schemas/responses/UserProfileResponse.ts b/src/schemas/responses/UserProfileResponse.ts index 1a5fdc9..ee1eee6 100644 --- a/src/schemas/responses/UserProfileResponse.ts +++ b/src/schemas/responses/UserProfileResponse.ts @@ -16,33 +16,19 @@ along with this program. If not, see . */ -import { - Badge, - Member, - User, -} from "@spacebar/util"; -import { - PublicConnectedAccount, - PublicMember, - PublicUser, -} from "@spacebar/schemas"; +import { Badge, Member, User } from "@spacebar/util"; +import { PublicConnectedAccount, PublicMember, PublicUser } from "@spacebar/schemas"; export type MutualGuild = { id: string; nick?: string; }; -export type PublicMemberProfile = Pick< - Member, - "banner" | "bio" | "guild_id" -> & { +export type PublicMemberProfile = Pick & { accent_color: null; // TODO }; -export type UserProfile = Pick< - User, - "bio" | "accent_color" | "banner" | "pronouns" | "theme_colors" ->; +export type UserProfile = Pick; export interface UserProfileResponse { user: PublicUser; diff --git a/src/schemas/responses/UserRelationsResponse.ts b/src/schemas/responses/UserRelationsResponse.ts index 808dd3d..377cab0 100644 --- a/src/schemas/responses/UserRelationsResponse.ts +++ b/src/schemas/responses/UserRelationsResponse.ts @@ -17,8 +17,4 @@ */ import { User } from "@spacebar/util"; -export type UserRelationsResponse = (Pick & - Pick & - Pick & - Pick & - Pick)[]; +export type UserRelationsResponse = (Pick & Pick & Pick & Pick & Pick)[]; diff --git a/src/schemas/responses/UserRelationshipsResponse.ts b/src/schemas/responses/UserRelationshipsResponse.ts index a0f5ff5..0f12054 100644 --- a/src/schemas/responses/UserRelationshipsResponse.ts +++ b/src/schemas/responses/UserRelationshipsResponse.ts @@ -16,7 +16,7 @@ along with this program. If not, see . */ -import { PublicUser, RelationshipType } from "@spacebar/schemas" +import { PublicUser, RelationshipType } from "@spacebar/schemas"; export interface UserRelationshipsResponse { id: string; diff --git a/src/schemas/uncategorised/AutomodRuleSchema.ts b/src/schemas/uncategorised/AutomodRuleSchema.ts index bc75108..38e8fae 100644 --- a/src/schemas/uncategorised/AutomodRuleSchema.ts +++ b/src/schemas/uncategorised/AutomodRuleSchema.ts @@ -45,11 +45,7 @@ name: string; position: number; trigger_type: number; //AutomodTriggerTypes - trigger_metadata: - | AutomodMentionSpamRuleSchema - | AutomodSuspectedSpamRuleSchema - | AutomodCommonlyFlaggedWordsRuleSchema - | AutomodCustomWordsRuleSchema; + trigger_metadata: AutomodMentionSpamRuleSchema | AutomodSuspectedSpamRuleSchema | AutomodCommonlyFlaggedWordsRuleSchema | AutomodCustomWordsRuleSchema; } export interface AutomodRuleSchemaWithId extends AutomodRuleSchema { diff --git a/src/schemas/uncategorised/GreetRequestSchema.ts b/src/schemas/uncategorised/GreetRequestSchema.ts index 28d1fdd..2a580f1 100644 --- a/src/schemas/uncategorised/GreetRequestSchema.ts +++ b/src/schemas/uncategorised/GreetRequestSchema.ts @@ -21,10 +21,10 @@ export interface GreetRequestSchema { sticker_ids: string[]; allowed_mentions?: AllowedMentions; - message_reference?: { + message_reference?: { message_id: string; channel_id?: string; guild_id?: string; fail_if_not_exists?: boolean; }; -} \ No newline at end of file +} diff --git a/src/schemas/uncategorised/MessageAcknowledgeSchema.ts b/src/schemas/uncategorised/MessageAcknowledgeSchema.ts index 9df6062..0075fb3 100644 --- a/src/schemas/uncategorised/MessageAcknowledgeSchema.ts +++ b/src/schemas/uncategorised/MessageAcknowledgeSchema.ts @@ -42,4 +42,4 @@ IS_GUILD_CHANNEL = 1 << 0, IS_THREAD = 1 << 1, IS_MENTION_LOW_IMPORTANCE = 1 << 2, -} \ No newline at end of file +} diff --git a/src/schemas/uncategorised/RelationshipPutSchema.ts b/src/schemas/uncategorised/RelationshipPutSchema.ts index 4d2438e..563e46d 100644 --- a/src/schemas/uncategorised/RelationshipPutSchema.ts +++ b/src/schemas/uncategorised/RelationshipPutSchema.ts @@ -25,4 +25,4 @@ incoming = 3, blocked = 2, friends = 1, -} \ No newline at end of file +} diff --git a/src/schemas/uncategorised/SettingsProtoUpdateSchema.ts b/src/schemas/uncategorised/SettingsProtoUpdateSchema.ts index 2b930bc..a7e884e 100644 --- a/src/schemas/uncategorised/SettingsProtoUpdateSchema.ts +++ b/src/schemas/uncategorised/SettingsProtoUpdateSchema.ts @@ -44,4 +44,4 @@ // export interface SettingsProtoUpdateTestSettingsSchema { // settings: {}; // required_data_version?: number; -// } \ No newline at end of file +// } diff --git a/src/schemas/uncategorised/UploadAttachmentRequestSchema.ts b/src/schemas/uncategorised/UploadAttachmentRequestSchema.ts index 60bf89f..0ad3a7c 100644 --- a/src/schemas/uncategorised/UploadAttachmentRequestSchema.ts +++ b/src/schemas/uncategorised/UploadAttachmentRequestSchema.ts @@ -16,7 +16,6 @@ along with this program. If not, see . */ - export interface UploadAttachmentRequestSchema { files: UploadAttachmentRequest[]; } diff --git a/src/schemas/uncategorised/UserGuildSettingsSchema.ts b/src/schemas/uncategorised/UserGuildSettingsSchema.ts index d0fe24f..20de7e5 100644 --- a/src/schemas/uncategorised/UserGuildSettingsSchema.ts +++ b/src/schemas/uncategorised/UserGuildSettingsSchema.ts @@ -19,8 +19,7 @@ import { ChannelOverride, UserGuildSettings } from "@spacebar/schemas"; // This sucks. I would use a DeepPartial, my own or typeorms, but they both generate inncorect schema -export interface UserGuildSettingsSchema - extends Partial> { +export interface UserGuildSettingsSchema extends Partial> { channel_overrides?: { [channel_id: string]: ChannelOverride; }; diff --git a/src/schemas/uncategorised/WebAuthnSchema.ts b/src/schemas/uncategorised/WebAuthnSchema.ts index 3f5e0da..ada20de 100644 --- a/src/schemas/uncategorised/WebAuthnSchema.ts +++ b/src/schemas/uncategorised/WebAuthnSchema.ts @@ -28,9 +28,7 @@ ticket: string; } -export type WebAuthnPostSchema = - | GenerateWebAuthnCredentialsSchema - | CreateWebAuthnCredentialSchema; +export type WebAuthnPostSchema = GenerateWebAuthnCredentialsSchema | CreateWebAuthnCredentialSchema; export interface WebAuthnTotpSchema { code: string; diff --git a/src/schemas/uncategorised/WebhookExecuteSchema.ts b/src/schemas/uncategorised/WebhookExecuteSchema.ts index d95606c..4957c02 100644 --- a/src/schemas/uncategorised/WebhookExecuteSchema.ts +++ b/src/schemas/uncategorised/WebhookExecuteSchema.ts @@ -16,11 +16,8 @@ along with this program. If not, see . */ -import { Embed } from "@spacebar/schemas" -import { - MessageCreateAttachment, - PollCreationSchema, -} from "./MessageCreateSchema"; +import { Embed } from "@spacebar/schemas"; +import { MessageCreateAttachment, PollCreationSchema } from "./MessageCreateSchema"; export interface WebhookExecuteSchema { content?: string; diff --git a/src/util/util/DateBuilder.ts b/src/util/util/DateBuilder.ts index e9c623a..cb71a33 100644 --- a/src/util/util/DateBuilder.ts +++ b/src/util/util/DateBuilder.ts @@ -89,4 +89,4 @@ buildTimestamp() { return this.date.getTime(); } -} \ No newline at end of file +} diff --git a/src/util/util/ElapsedTime.test.ts b/src/util/util/ElapsedTime.test.ts index 012ecfa..dc9a82e 100644 --- a/src/util/util/ElapsedTime.test.ts +++ b/src/util/util/ElapsedTime.test.ts @@ -75,4 +75,4 @@ test("ElapsedTime should return correct days", () => { const db = new ElapsedTime(172800000000000n); // 2 days assert.equal(db.days, 2); -}); \ No newline at end of file +}); diff --git a/src/util/util/ElapsedTime.ts b/src/util/util/ElapsedTime.ts index 08f246a..e87b886 100644 --- a/src/util/util/ElapsedTime.ts +++ b/src/util/util/ElapsedTime.ts @@ -81,4 +81,4 @@ return `${daysPart}${hoursPart}:${minutesPart}:${secondsPart}.${millisecondsPart}${microsecondsPart}${nanosecondsPart}`; } -} \ No newline at end of file +} diff --git a/src/util/util/Token.ts b/src/util/util/Token.ts index cc19d85..e6dff76 100644 --- a/src/util/util/Token.ts +++ b/src/util/util/Token.ts @@ -171,7 +171,7 @@ is_admin_session: isAdminSession, client_status: {}, status: "online", - client_info: { }, + client_info: {}, }); } while (await Session.findOne({ where: { session_id: newSession.session_id } }));