Skip to content

Commit

Permalink
fix: lilybird things
Browse files Browse the repository at this point in the history
  • Loading branch information
xhyrom committed Jul 20, 2024
1 parent 3ff1b06 commit 9315765
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/docs.ts
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/commands/github.ts
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion src/commands/mdn.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/commands/ping.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/tag.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
2 changes: 1 addition & 1 deletion src/commands/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { $applicationCommand } from "@lilybird/handlers/advanced";
import { $applicationCommand } from "../handler.ts";

import {
COMMIT_HASH,
Expand Down
8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);

Expand All @@ -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({
Expand Down

0 comments on commit 9315765

Please sign in to comment.