Skip to content
Open

fix? #24

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion import_map.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"template/": "./src/",
"sift/": "https://deno.land/x/[email protected]/",
"discordeno/": "https://deno.land/x/[email protected]/",
"encoding/": "https://deno.land/[email protected]/encoding/"
"encoding/": "https://deno.land/[email protected]/encoding/",
"camelize/": "https://deno.land/x/[email protected]/"
}
}
4 changes: 2 additions & 2 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
InteractionTypes,
verifySignature
} from "discordeno/mod.ts";
import { camelize } from 'https://deno.land/x/camelize@2.0.0/mod.ts';
import { camelize } from "camelize/mod.ts";

import { commands } from "template/commands/mod.ts";
import { translate } from "template/languages/mod.ts";
Expand Down Expand Up @@ -92,7 +92,7 @@ async function main(request: Request) {
data: {
content: translate(
// discordeno marks guildId as bigint, so need to convert it to string, else translate function throws error
payload.guildId! as unknown as string,
payload.guildId!,
"MISSING_PERM_LEVEL",
),
},
Expand Down
4 changes: 2 additions & 2 deletions src/languages/translate.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { languages } from "template/languages/mod.ts";

/** This should hold the language names per guild id. <guildId, language> */
export const serverLanguages = new Map<string, string>();
export const serverLanguages = new Map<bigint, string>();

export function translate (
guildId: string,
guildId: bigint,
key: string,
...args: unknown[]
): string {
Expand Down