mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-12-03 11:21:05 +01:00
fix: lilybird things
This commit is contained in:
parent
3ff1b06150
commit
9315765650
10 changed files with 14 additions and 12 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -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
BIN
bun.lockb
Binary file not shown.
|
@ -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",
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { $applicationCommand } from "@lilybird/handlers/advanced";
|
||||
import { $applicationCommand } from "../handler.ts";
|
||||
|
||||
import {
|
||||
COMMIT_HASH,
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue