fix: lilybird things

This commit is contained in:
Jozef Steinhübl 2024-07-20 18:40:59 +02:00
parent 3ff1b06150
commit 9315765650
No known key found for this signature in database
GPG key ID: E6BC90C91973B08F
10 changed files with 14 additions and 12 deletions

2
.gitignore vendored
View file

@ -1,7 +1,7 @@
# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node
files/database.sqlite
**/lily-cache/
### Node ###
# Logs

BIN
bun.lockb

Binary file not shown.

View file

@ -14,7 +14,7 @@
"prettier": "3.3.3"
},
"dependencies": {
"@lilybird/handlers": "^0.6.0-beta.9",
"@lilybird/handlers": "^0.6.0-beta.11",
"@lilybird/jsx": "0.3.0",
"@lilybird/transformers": "^0.4.1",
"@paperdave/logger": "^3.0.1",

View file

@ -1,7 +1,7 @@
import { AllowedMentionType, ApplicationCommandOptionType } from "lilybird";
import { $applicationCommand } from "@lilybird/handlers/advanced";
import { $applicationCommand } from "../handler.ts";
import algoliasearch from "algoliasearch";
import { safeSlice } from "src/util.ts";
import { safeSlice } from "../util.ts";
// @ts-expect-error It is callable, but algolia for some reason has a namespace with the same name
const algoliaClient = algoliasearch(

View file

@ -1,5 +1,5 @@
import { $applicationCommand } from "@lilybird/handlers/advanced";
import { ApplicationCommandOptionType } from "lilybird";
import { $applicationCommand } from "../handler.ts";
import { safeSlice, silently } from "../util.ts";
type State =

View file

@ -1,7 +1,7 @@
// https://github.com/discordjs/discord-utils-bot/blob/main/src/functions/autocomplete/mdnAutoComplete.ts#L23-L47 thanks
// https://github.com/discordjs/discord-utils-bot/blob/main/src/functions/mdn.ts#L59C1-L78C3 thanks
import { ApplicationCommandOptionType, AllowedMentionType } from "lilybird";
import { $applicationCommand } from "@lilybird/handlers/advanced";
import { $applicationCommand } from "../handler.ts";
import { MDN_API, MDN_DISCORD_EMOJI } from "src/constants.ts";
import { safeSlice, silently } from "src/util.ts";

View file

@ -1,4 +1,4 @@
import { $applicationCommand } from "@lilybird/handlers/advanced";
import { $applicationCommand } from "../handler.ts";
import { serializers as S } from "@purplet/serialize";
import { ActionRow, Button } from "@lilybird/jsx";
import { possibleClosedForm, silently } from "../util.ts";

View file

@ -1,5 +1,5 @@
import { AllowedMentionType, ApplicationCommandOptionType } from "lilybird";
import { $applicationCommand } from "@lilybird/handlers/advanced";
import { $applicationCommand } from "../handler.ts";
import { getTags, searchTag } from "../loaders/tags.ts";
$applicationCommand({

View file

@ -1,4 +1,4 @@
import { $applicationCommand } from "@lilybird/handlers/advanced";
import { $applicationCommand } from "../handler.ts";
import {
COMMIT_HASH,

View file

@ -11,6 +11,7 @@ process.on("uncaughtException", console.error);
handler.cachePath = `${import.meta.dir}/lily-cache/handler`;
handler.addDebugListener(console.log);
await handler.scanDir(`${import.meta.dir}/commands`);
await handler.scanDir(`${import.meta.dir}/listeners`);
@ -29,12 +30,13 @@ const listeners =
if (
typeof listeners.messageCreate !== "undefined" &&
typeof messageCreate !== "undefined"
)
) {
const oldListener = listeners.messageCreate!;
listeners.messageCreate = async (m) => {
await listeners.messageCreate!(m);
await oldListener(m);
await messageCreate(m);
};
else if (typeof messageCreate !== "undefined")
} else if (typeof messageCreate !== "undefined")
listeners.messageCreate = messageCreate;
await createClient({