{"id":16527174,"url":"https://github.com/zignis/emoji-parser-legacy","last_synced_at":"2026-05-08T22:07:18.420Z","repository":{"id":140762626,"uuid":"401284512","full_name":"zignis/emoji-parser-legacy","owner":"zignis","description":"Webhook parser for Discord custom emojis","archived":false,"fork":false,"pushed_at":"2022-01-06T03:33:49.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T05:11:58.362Z","etag":null,"topics":["discord"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zignis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-30T09:19:02.000Z","updated_at":"2022-02-17T08:52:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"58579f5f-34e9-42d0-af96-ba900eb63e92","html_url":"https://github.com/zignis/emoji-parser-legacy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zignis/emoji-parser-legacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zignis%2Femoji-parser-legacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zignis%2Femoji-parser-legacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zignis%2Femoji-parser-legacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zignis%2Femoji-parser-legacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zignis","download_url":"https://codeload.github.com/zignis/emoji-parser-legacy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zignis%2Femoji-parser-legacy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32799255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["discord"],"created_at":"2024-10-11T17:33:53.718Z","updated_at":"2026-05-08T22:07:18.406Z","avatar_url":"https://github.com/zignis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# emojiParser-legacy\nThis parser was used in the legacy `v3` series of Comio, until it was finally deprecated in the `v4` series due to Discord's terms of use violation.\n\n## Terminology\n\n```js\nlet substringArray = get_substrings_between(message.content, \":\", \":\");\nlet msg = message.content;\nif (!substringArray.length) return;\n\nsubstringArray.forEach(m =\u003e {\n  let emoji = client.emojis.cache.find(x =\u003e x.name === m);\n  var replace = `:${m}:`;\n  var regReplace = new RegExp(replace, 'g');\n  const replaceInteger = msg.replace(/[0-9]/g, '');\n  const emojiInteger = replace.replace(/[0-9]/g, '');\n  if (replaceInteger.includes(`\u003c${emojiInteger}\u003e`) || replaceInteger.includes(`\u003ca${emojiInteger}\u003e`)) return;\n  if(emoji \u0026\u0026 !msg.split(\" \").find(x =\u003e x === emoji.toString()) \u0026\u0026 !msg.includes(`\u003c${replace}${emoji.id}\u003e`) \u0026\u0026 !msg.includes(`\u003ca${replace}${emoji.id}\u003e`)) {\n    msg = msg.replace(regReplace, emoji.toString());\n  };\n});\n```\nMessage content is breaked into chunks having custom emojis or unicode emojis (:), and each chunk is checked if it's a valid custom emoji and the client can access it. A new Regex is built which replaces all the chunks matching the custom emoji.\n```js\nlet webhook = await message.channel.fetchWebhooks();\nwebhook = webhook.find(x =\u003e x.name === \"Webhook Emojis\");\n\nif (!webhook) {\n  webhook = await message.channel.createWebhook(`Webhook Emojis`, {\n    avatar: client.user.displayAvatarURL({ dynamic: true })\n  });\n};\n\nawait webhook.edit({\n  name: message.member.nickname ? message.member.nickname : message.author.username,\n  avatar: message.author.displayAvatarURL({ dynamic: true })\n});\n\nmessage.delete()\n  .catch(console.error);\n  \nwebhook.send({ content: msg })\n  .catch(console.error);\n  \nawait webhook.edit({\n  name: `Webhook Emojis`,\n  avatar: client.user.displayAvatarURL({ dynamic: true })\n});\n```\nA webhook named as `Webhook Emojis` is resolved, then its name and avatar is replaced by the message author's name and avatar to replicate the author. Finally the original message is deleted and a new webhook message is sent in the message's channel having the custom emojis.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzignis%2Femoji-parser-legacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzignis%2Femoji-parser-legacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzignis%2Femoji-parser-legacy/lists"}