feat: more emojis

This commit is contained in:
Jozef Steinhübl 2024-03-31 21:00:41 +02:00
parent 5c7e057baa
commit c4dd11d3fc
7 changed files with 14 additions and 10 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -13,6 +13,7 @@
"dependencies": {
"@lilybird/handlers": "0.4.0-alpha.2",
"@lilybird/jsx": "0.2.0",
"@lilybird/transformers": "0.2.0-alpha.1",
"@paperdave/logger": "^3.0.1",
"algoliasearch": "^4.23.2",
"gray-matter": "^4.0.3",

View file

@ -37,4 +37,7 @@ export const BUN_EMOJIS = [
{ name: "octobun", id: "1210663393480941598" },
{ name: "bunparty", id: "1210663548963921960" },
{ name: "bunsplode", id: "1210663666454634586" },
{ name: "bundowspet", id: "1222860633377341461", animated: true },
{ name: "bunpet", id: "1172808445737574591", animated: true },
{ name: "bunsegfault", id: "1175208306533486632", animated: true },
];

View file

@ -1,4 +1,5 @@
import { Message, ButtonStyle } from "lilybird";
import { ButtonStyle } from "lilybird";
import { Message } from "@lilybird/transformers";
import { ActionRow, Button } from "@lilybird/jsx";
import { extname, basename } from "node:path";
import { Event } from "@lilybird/handlers";

View file

@ -1,5 +1,5 @@
import { Event } from "@lilybird/handlers";
import { PartialMessage } from "lilybird";
import { PartialMessage } from "@lilybird/transformers";
import { isBunOnlyLikeMessage } from "src/util.ts";
export default {

View file

@ -1,8 +1,5 @@
import {
PartialChannel,
GuildTextChannel,
ApplicationCommandOptionChoiceStructure,
} from "lilybird";
import { ApplicationCommandOptionChoiceStructure } from "lilybird";
import { PartialChannel, GuildTextChannel } from "@lilybird/transformers";
import { Tag } from "../structs/Tag.ts";
import { readFileSync } from "node:fs";
import { safeSlice } from "../util.ts";

View file

@ -1,4 +1,4 @@
import { GuildMember } from "lilybird";
import { GuildMember } from "@lilybird/transformers";
import { BUN_EMOJIS } from "./constants.ts";
export function safeSlice<T extends string | Array<any>>(
@ -32,8 +32,10 @@ export function isBunOnlyLikeMessage(content?: string) {
if (!content) return false;
if (content === "bun") return true;
return BUN_EMOJIS.some(
(emoji) => content.replace(/<:|>/g, "") == `${emoji.name}:${emoji.id}`
return BUN_EMOJIS.some((emoji) =>
emoji.animated
? content.replace(/<a:|>/g, "") == `${emoji.name}:${emoji.id}`
: content.replace(/<:|>/g, "") == `${emoji.name}:${emoji.id}`
);
}