diff --git a/app/lib/discord/bot.ts b/app/lib/discord/bot.ts index ba369e0..43e4d78 100644 --- a/app/lib/discord/bot.ts +++ b/app/lib/discord/bot.ts @@ -126,7 +126,6 @@ export class Bot extends REST { } errorEmbed(msg?: string): APIEmbed { - console.log("Error:", msg); return { title: "Error", description: msg ?? "There was an error executing your request", @@ -134,7 +133,7 @@ export class Bot extends REST { }; } - defer(ephemeral: boolean = true): APIInteractionResponse { + defer(ephemeral = true): APIInteractionResponse { return { type: InteractionResponseType.DeferredChannelMessageWithSource, data: { diff --git a/app/lib/discord/commands/helpful.ts b/app/lib/discord/commands/helpful.ts index 2dde627..ecc3235 100644 --- a/app/lib/discord/commands/helpful.ts +++ b/app/lib/discord/commands/helpful.ts @@ -88,7 +88,8 @@ export default class HelpfulCommand data: { embeds: [ bot.errorEmbed( - `${threadChannel.parent_id}, ${bot["help-channels"].size}, ${ids}}` + "Thread is not inside a valid help channel." + // `${threadChannel.parent_id}, ${bot["help-channels"].size}, ${ids}}` ), ], flags: MessageFlags.Ephemeral, diff --git a/dbschema/edgeql-js/__spec__.ts b/dbschema/edgeql-js/__spec__.ts index fb689a7..dadc419 100644 --- a/dbschema/edgeql-js/__spec__.ts +++ b/dbschema/edgeql-js/__spec__.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "./reflection"; const spec: $.introspect.Types = new $.StrictMap(); diff --git a/dbschema/edgeql-js/cardinality.ts b/dbschema/edgeql-js/cardinality.ts index 6d45cfe..9b3ecfc 100644 --- a/dbschema/edgeql-js/cardinality.ts +++ b/dbschema/edgeql-js/cardinality.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { Cardinality } from "edgedb/dist/reflection/index"; import type { TypeSet } from "./typesystem"; diff --git a/dbschema/edgeql-js/cast.ts b/dbschema/edgeql-js/cast.ts index c0d93d4..6c63794 100644 --- a/dbschema/edgeql-js/cast.ts +++ b/dbschema/edgeql-js/cast.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { ExpressionKind, Cardinality } from "edgedb/dist/reflection/index"; import type { diff --git a/dbschema/edgeql-js/castMaps.ts b/dbschema/edgeql-js/castMaps.ts index d6bf226..439fad6 100644 --- a/dbschema/edgeql-js/castMaps.ts +++ b/dbschema/edgeql-js/castMaps.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as edgedb from "edgedb"; import type * as $ from "./reflection"; diff --git a/dbschema/edgeql-js/casting.ts b/dbschema/edgeql-js/casting.ts index c91b7f7..113d50a 100644 --- a/dbschema/edgeql-js/casting.ts +++ b/dbschema/edgeql-js/casting.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { Cardinality } from "edgedb/dist/reflection/index"; import type { diff --git a/dbschema/edgeql-js/collections.ts b/dbschema/edgeql-js/collections.ts index 0a56ecc..927acb1 100644 --- a/dbschema/edgeql-js/collections.ts +++ b/dbschema/edgeql-js/collections.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { Cardinality, diff --git a/dbschema/edgeql-js/detached.ts b/dbschema/edgeql-js/detached.ts index 5d58732..4300f40 100644 --- a/dbschema/edgeql-js/detached.ts +++ b/dbschema/edgeql-js/detached.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { ExpressionKind } from "edgedb/dist/reflection/index"; import type { Expression, TypeSet } from "./typesystem"; diff --git a/dbschema/edgeql-js/external.ts b/dbschema/edgeql-js/external.ts index 8a37ee1..256ce48 100644 --- a/dbschema/edgeql-js/external.ts +++ b/dbschema/edgeql-js/external.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 export { literal } from "./literal"; export {} from "./path"; diff --git a/dbschema/edgeql-js/for.ts b/dbschema/edgeql-js/for.ts index c2dd219..771a436 100644 --- a/dbschema/edgeql-js/for.ts +++ b/dbschema/edgeql-js/for.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { Cardinality, ExpressionKind } from "edgedb/dist/reflection/index"; import { cardutil } from "./cardinality"; diff --git a/dbschema/edgeql-js/funcops.ts b/dbschema/edgeql-js/funcops.ts index de7c6af..8854fce 100644 --- a/dbschema/edgeql-js/funcops.ts +++ b/dbschema/edgeql-js/funcops.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { Cardinality, diff --git a/dbschema/edgeql-js/globals.ts b/dbschema/edgeql-js/globals.ts index e87e53d..63eb98c 100644 --- a/dbschema/edgeql-js/globals.ts +++ b/dbschema/edgeql-js/globals.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { type Cardinality, ExpressionKind } from "edgedb/dist/reflection/index"; import type { Expression, BaseType } from "./typesystem"; diff --git a/dbschema/edgeql-js/group.ts b/dbschema/edgeql-js/group.ts index 04a0945..d95f0c6 100644 --- a/dbschema/edgeql-js/group.ts +++ b/dbschema/edgeql-js/group.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { Expression, diff --git a/dbschema/edgeql-js/hydrate.ts b/dbschema/edgeql-js/hydrate.ts index c718bc4..c566295 100644 --- a/dbschema/edgeql-js/hydrate.ts +++ b/dbschema/edgeql-js/hydrate.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { $ } from "edgedb"; diff --git a/dbschema/edgeql-js/imports.ts b/dbschema/edgeql-js/imports.ts index 3bfd815..1f9ab18 100644 --- a/dbschema/edgeql-js/imports.ts +++ b/dbschema/edgeql-js/imports.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 export * as edgedb from "edgedb"; export { spec } from "./__spec__"; diff --git a/dbschema/edgeql-js/index.ts b/dbschema/edgeql-js/index.ts index 4637d2c..8b45b7a 100644 --- a/dbschema/edgeql-js/index.ts +++ b/dbschema/edgeql-js/index.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 export * from "./external"; export { createClient } from "edgedb"; diff --git a/dbschema/edgeql-js/insert.ts b/dbschema/edgeql-js/insert.ts index 5a0bb82..95034ba 100644 --- a/dbschema/edgeql-js/insert.ts +++ b/dbschema/edgeql-js/insert.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { Cardinality, diff --git a/dbschema/edgeql-js/json.ts b/dbschema/edgeql-js/json.ts index 097c006..69f9e90 100644 --- a/dbschema/edgeql-js/json.ts +++ b/dbschema/edgeql-js/json.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { ExpressionKind, TypeKind } from "edgedb/dist/reflection/index"; import type { ParamType } from "./typesystem"; diff --git a/dbschema/edgeql-js/literal.ts b/dbschema/edgeql-js/literal.ts index 5453902..fca73e4 100644 --- a/dbschema/edgeql-js/literal.ts +++ b/dbschema/edgeql-js/literal.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { Expression, diff --git a/dbschema/edgeql-js/modules/_default_10.ts b/dbschema/edgeql-js/modules/_default_10.ts index 4477d2b..6d8c826 100644 --- a/dbschema/edgeql-js/modules/_default_10.ts +++ b/dbschema/edgeql-js/modules/_default_10.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/cal.ts b/dbschema/edgeql-js/modules/cal.ts index d53935a..f94a48a 100644 --- a/dbschema/edgeql-js/modules/cal.ts +++ b/dbschema/edgeql-js/modules/cal.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/cfg.ts b/dbschema/edgeql-js/modules/cfg.ts index bcce37a..8ee66a2 100644 --- a/dbschema/edgeql-js/modules/cfg.ts +++ b/dbschema/edgeql-js/modules/cfg.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/default.ts b/dbschema/edgeql-js/modules/default.ts index bd4f81c..3ef834a 100644 --- a/dbschema/edgeql-js/modules/default.ts +++ b/dbschema/edgeql-js/modules/default.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/discord.ts b/dbschema/edgeql-js/modules/discord.ts index 80ad2fd..e2948e4 100644 --- a/dbschema/edgeql-js/modules/discord.ts +++ b/dbschema/edgeql-js/modules/discord.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/ext.ts b/dbschema/edgeql-js/modules/ext.ts index 1b005cd..4c55d5e 100644 --- a/dbschema/edgeql-js/modules/ext.ts +++ b/dbschema/edgeql-js/modules/ext.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/ext/auth.ts b/dbschema/edgeql-js/modules/ext/auth.ts index f548f5f..75d4ad7 100644 --- a/dbschema/edgeql-js/modules/ext/auth.ts +++ b/dbschema/edgeql-js/modules/ext/auth.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../../reflection"; import * as _ from "../../imports"; diff --git a/dbschema/edgeql-js/modules/ext/pgcrypto.ts b/dbschema/edgeql-js/modules/ext/pgcrypto.ts index a38d228..083438b 100644 --- a/dbschema/edgeql-js/modules/ext/pgcrypto.ts +++ b/dbschema/edgeql-js/modules/ext/pgcrypto.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../../reflection"; import * as _ from "../../imports"; diff --git a/dbschema/edgeql-js/modules/fts.ts b/dbschema/edgeql-js/modules/fts.ts index 8240a18..7b4c9d8 100644 --- a/dbschema/edgeql-js/modules/fts.ts +++ b/dbschema/edgeql-js/modules/fts.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/math.ts b/dbschema/edgeql-js/modules/math.ts index 05b1894..8099ee8 100644 --- a/dbschema/edgeql-js/modules/math.ts +++ b/dbschema/edgeql-js/modules/math.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/schema.ts b/dbschema/edgeql-js/modules/schema.ts index c8c3a30..180bdf8 100644 --- a/dbschema/edgeql-js/modules/schema.ts +++ b/dbschema/edgeql-js/modules/schema.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/std.ts b/dbschema/edgeql-js/modules/std.ts index 39bdcb8..0b67fb7 100644 --- a/dbschema/edgeql-js/modules/std.ts +++ b/dbschema/edgeql-js/modules/std.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/modules/std/enc.ts b/dbschema/edgeql-js/modules/std/enc.ts index 79e1bad..94637f7 100644 --- a/dbschema/edgeql-js/modules/std/enc.ts +++ b/dbschema/edgeql-js/modules/std/enc.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../../reflection"; import * as _ from "../../imports"; diff --git a/dbschema/edgeql-js/modules/sys.ts b/dbschema/edgeql-js/modules/sys.ts index 42d506b..0ff2405 100644 --- a/dbschema/edgeql-js/modules/sys.ts +++ b/dbschema/edgeql-js/modules/sys.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "../reflection"; import * as _ from "../imports"; diff --git a/dbschema/edgeql-js/operators.ts b/dbschema/edgeql-js/operators.ts index a5ff665..2706596 100644 --- a/dbschema/edgeql-js/operators.ts +++ b/dbschema/edgeql-js/operators.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "./reflection"; import * as _ from "./imports"; diff --git a/dbschema/edgeql-js/params.ts b/dbschema/edgeql-js/params.ts index 24b0180..c51980d 100644 --- a/dbschema/edgeql-js/params.ts +++ b/dbschema/edgeql-js/params.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { Executor } from "edgedb"; import { diff --git a/dbschema/edgeql-js/path.ts b/dbschema/edgeql-js/path.ts index 6013921..eaf9116 100644 --- a/dbschema/edgeql-js/path.ts +++ b/dbschema/edgeql-js/path.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { // cardutil, diff --git a/dbschema/edgeql-js/query.ts b/dbschema/edgeql-js/query.ts index a071a44..1993858 100644 --- a/dbschema/edgeql-js/query.ts +++ b/dbschema/edgeql-js/query.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type * as edgedb from "edgedb"; import { Cardinality, ExpressionKind } from "edgedb/dist/reflection/index"; diff --git a/dbschema/edgeql-js/range.ts b/dbschema/edgeql-js/range.ts index eae0944..9574730 100644 --- a/dbschema/edgeql-js/range.ts +++ b/dbschema/edgeql-js/range.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { LocalDate, LocalDateTime, Duration } from "edgedb"; import { Range } from "edgedb"; diff --git a/dbschema/edgeql-js/reflection.ts b/dbschema/edgeql-js/reflection.ts index cc4e3aa..03fc252 100644 --- a/dbschema/edgeql-js/reflection.ts +++ b/dbschema/edgeql-js/reflection.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 export * from "edgedb/dist/reflection/index"; export * from "./typesystem"; diff --git a/dbschema/edgeql-js/select.ts b/dbschema/edgeql-js/select.ts index 4d740cc..64cd296 100644 --- a/dbschema/edgeql-js/select.ts +++ b/dbschema/edgeql-js/select.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { LocalDateTime, diff --git a/dbschema/edgeql-js/set.ts b/dbschema/edgeql-js/set.ts index f064784..33fd409 100644 --- a/dbschema/edgeql-js/set.ts +++ b/dbschema/edgeql-js/set.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { ExpressionKind, Cardinality } from "edgedb/dist/reflection/index"; import { TypeKind } from "edgedb/dist/reflection/index"; diff --git a/dbschema/edgeql-js/setImpl.ts b/dbschema/edgeql-js/setImpl.ts index 676f518..17b5d4c 100644 --- a/dbschema/edgeql-js/setImpl.ts +++ b/dbschema/edgeql-js/setImpl.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import * as $ from "./reflection"; import * as castMaps from "./castMaps"; diff --git a/dbschema/edgeql-js/syntax.ts b/dbschema/edgeql-js/syntax.ts index a255514..0e8d928 100644 --- a/dbschema/edgeql-js/syntax.ts +++ b/dbschema/edgeql-js/syntax.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { TypeSet, setToTsType } from "./typesystem"; diff --git a/dbschema/edgeql-js/toEdgeQL.ts b/dbschema/edgeql-js/toEdgeQL.ts index a7736eb..1212c64 100644 --- a/dbschema/edgeql-js/toEdgeQL.ts +++ b/dbschema/edgeql-js/toEdgeQL.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { Duration, @@ -8,6 +8,7 @@ import { RelativeDuration, DateDuration, Range, + InputDataError, } from "edgedb"; import { Cardinality, @@ -1450,13 +1451,34 @@ const numericalTypes: Record = { "std::float64": true, }; +function makeLabel(stringified: string): string { + const MAX_ITERATIONS = 100; + const prefix = "jsonliteral"; + let counter = 0; + let label = `${prefix}`; + + while (stringified.includes(`$${label}$`) && counter < MAX_ITERATIONS) { + label = `${prefix}${counter}`; + counter++; + } + + if (counter >= MAX_ITERATIONS) { + throw new InputDataError( + "Counter reached 100 without finding a unique label.", + ); + } + return label; +} + function literalToEdgeQL(type: BaseType, val: any): string { const typename = (type as any).__casttype__?.__name__ ?? type.__name__; let skipCast = false; let stringRep; if (typename === "std::json") { skipCast = true; - stringRep = `to_json($$${JSON.stringify(val)}$$)`; + const stringified = JSON.stringify(val); + const label = `$${makeLabel(stringified)}$`; + stringRep = `to_json(${label}${JSON.stringify(val)}${label})`; } else if (typeof val === "string") { if (numericalTypes[typename]) { skipCast = typename === type.__name__; diff --git a/dbschema/edgeql-js/typesystem.ts b/dbschema/edgeql-js/typesystem.ts index 9667fb3..c5d0105 100644 --- a/dbschema/edgeql-js/typesystem.ts +++ b/dbschema/edgeql-js/typesystem.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import type { Executor } from "edgedb/dist/ifaces"; import type { $expr_PathNode, $expr_TypeIntersection, $pathify } from "./path"; diff --git a/dbschema/edgeql-js/update.ts b/dbschema/edgeql-js/update.ts index a61e470..79514fc 100644 --- a/dbschema/edgeql-js/update.ts +++ b/dbschema/edgeql-js/update.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { ExpressionKind, diff --git a/dbschema/edgeql-js/with.ts b/dbschema/edgeql-js/with.ts index d0a1fc5..857d280 100644 --- a/dbschema/edgeql-js/with.ts +++ b/dbschema/edgeql-js/with.ts @@ -1,4 +1,4 @@ -// GENERATED by @edgedb/generate v0.5.4 +// GENERATED by @edgedb/generate v0.5.6 import { type Cardinality, ExpressionKind } from "edgedb/dist/reflection/index"; import type { BaseType, Expression, TypeSet } from "./typesystem";