{"id":24114746,"url":"https://github.com/minidomo/laifutil","last_synced_at":"2026-05-15T19:31:38.840Z","repository":{"id":37987926,"uuid":"435889975","full_name":"minidomo/laifutil","owner":"minidomo","description":"Identify and parse Discord embeds sent from LaifuBot.","archived":false,"fork":false,"pushed_at":"2022-07-23T14:50:17.000Z","size":1121,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T01:50:24.657Z","etag":null,"topics":["bot","discord","embed","laifu","laifubot","parser"],"latest_commit_sha":null,"homepage":"https://minidomo.github.io/laifutil/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minidomo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-07T13:25:00.000Z","updated_at":"2022-06-10T02:00:40.000Z","dependencies_parsed_at":"2022-07-12T00:17:13.819Z","dependency_job_id":null,"html_url":"https://github.com/minidomo/laifutil","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/minidomo/laifutil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minidomo%2Flaifutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minidomo%2Flaifutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minidomo%2Flaifutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minidomo%2Flaifutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minidomo","download_url":"https://codeload.github.com/minidomo/laifutil/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minidomo%2Flaifutil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33076159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","discord","embed","laifu","laifubot","parser"],"created_at":"2025-01-11T05:24:44.966Z","updated_at":"2026-05-15T19:31:38.821Z","avatar_url":"https://github.com/minidomo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003elaifutil\u003c/h1\u003e\n\n## About\n\nlaifutil is a library to identify and parse Discord embeds sent from [LaifuBot](https://laifubot.fandom.com/wiki/Laifubot_Wiki).\n\n## Installation\n\n```sh\nnpm install laifutil\n```\n\n## Example usage\n\nWe can make a simple bot to remind a user to drop after six minutes upon completing a drop code.\n\nUsing discord.js v13:\n\n```js\nconst { setTimeout } = require('node:timers/promises');\nconst { Client, Intents, Formatters } = require('discord.js');\nconst { isLaifuBot, isDropOpenedEmbed, DropOpenedEmbed } = require('laifutil');\n\nconst client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });\n\n// Six minutes in milliseconds\nconst dropInterval = 360_000;\n\nclient.once('ready', () =\u003e {\n    console.log(`Logged in as ${client.user.tag}!`);\n});\n\nclient.on('messageCreate', async message =\u003e {\n    const srcEmbed = message.embeds[0];\n\n    if (isLaifuBot(message.author.id) \u0026\u0026 srcEmbed) {\n        const apiEmbed = srcEmbed.toJSON();\n\n        if (isDropOpenedEmbed(apiEmbed)) {\n            const embed = new DropOpenedEmbed(apiEmbed);\n\n            if (embed.userId) {\n                await setTimeout(dropInterval);\n                const content = `Time to drop, ${Formatters.userMention(embed.userId)}!`;\n                message.reply({ content });\n            }\n        }\n    }\n});\n\nclient.login('token');\n```\n\nUsing discord.js v14:\n\n```js\nconst { setTimeout } = require('node:timers/promises');\nconst { Client, GatewayIntentBits, userMention } = require('discord.js');\nconst { isLaifuBot, isDropOpenedEmbed, DropOpenedEmbed } = require('laifutil');\n\nconst client = new Client({\n    intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent],\n});\n\n// Six minutes in milliseconds\nconst dropInterval = 360_000;\n\nclient.once('ready', () =\u003e {\n    console.log(`Logged in as ${client.user.tag}!`);\n});\n\nclient.on('messageCreate', async message =\u003e {\n    const srcEmbed = message.embeds[0];\n\n    if (isLaifuBot(message.author.id) \u0026\u0026 srcEmbed) {\n        const apiEmbed = srcEmbed.toJSON();\n\n        if (isDropOpenedEmbed(apiEmbed)) {\n            const embed = new DropOpenedEmbed(apiEmbed);\n\n            if (embed.userId) {\n                await setTimeout(dropInterval);\n                const content = `Time to drop, ${userMention(embed.userId)}!`;\n                message.reply({ content });\n            }\n        }\n    }\n});\n\nclient.login('token');\n```\n\n## Links\n\n-   [Documentation](https://minidomo.github.io/laifutil/)\n-   [GitHub](https://github.com/minidomo/laifutil)\n-   [npm](https://www.npmjs.com/package/laifutil)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminidomo%2Flaifutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminidomo%2Flaifutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminidomo%2Flaifutil/lists"}