npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@beret.27/discord-app-emojis

v1.3.5

Published

Discord application emoji manager pour Node.js and discord.js

Downloads

401

Readme

@beret.27/discord-app-emojis

Module npm pour gerer, synchroniser et reparer les emojis d'application Discord avec Node.js et discord.js. (ReadMe fait par IA, des bugs sont possibles, si le cas présent : merci de me contacter via discord : levraiberet)

Installation

npm install @beret.27/discord-app-emojis

API

  • getemoji(name, options)
  • getallemoji({ name })
  • getemojinumber()

Creation du module

const { createEmojiModule } = require('@beret.27/discord-app-emojis');

Tu peux l'initialiser de 2 facons:

1) Avec client Discord.js (recommande)

const emoji = await createEmojiModule({
  client, // client discord.js deja connecte
  emojiDir: './emojis',
  createDirIfMissing: true,
  normalizeUploads: true,
  normalizeSize: 128,
  normalizeFormat: 'png',
  cacheTtlMs: 30000,
  timeoutMs: 20000,
  syncOnInit: true,
  log: true, // mode logs
  logLevels: ['info', 'warn', 'error'],
  logEvents: ['sync-init-start', 'sync-init-done', 'create', 'update', 'delete'],
}).init();

2) Avec token (+ appId optionnel)

const emoji = await createEmojiModule({
  token: process.env.DISCORD_BOT_TOKEN,
  appId: process.env.DISCORD_APP_ID, // optionnel
  emojiDir: './emojis',
  createDirIfMissing: true,
  log: false,
}).init();

getemoji(name, options)

Retourne <:name:id> ou <a:name:id>.

Options:

  • update (boolean):
    • cree l'emoji si absent et fichier local present
    • met a jour si la comparaison visuelle locale/distante differe
  • delete (boolean):
    • supprime l'emoji distant de ce nom
  • default (string):
    • fallback en cas d'erreur / non trouve

Compat:

  • upload est toujours accepte comme alias de update.

Exemple:

const v = await emoji.getemoji('yes', {
  update: true,
  delete: false,
  default: '❓',
});

getallemoji({ name })

Retourne tous les emojis, ou seulement ceux dont le nom contient name.

const all = await emoji.getallemoji({ name: 'para' });

getemojinumber()

Retourne le nombre total d'emojis app du bot.

const count = await emoji.getemojinumber();

Parametres

createEmojiModule(options):

  • client (Discord.Client) optionnel
  • token (string) optionnel si client fourni
  • appId (string) optionnel
  • emojiDir (string) optionnel (defaut ./emojis)
  • createDirIfMissing (boolean) defaut true
  • timeoutMs (number) timeout API/CDN (defaut 20000)
  • cacheTtlMs (number) expiration cache en ms (defaut 30000)
  • refreshOnMiss (boolean) refetch si nom absent du cache (defaut true)
  • syncOnInit (boolean) resynchronise les emojis locaux au demarrage
  • syncOnInitMode (string) missing-only ou update-all
  • syncConcurrency (number) nombre max de traitements en parallele
  • updateStrategy (string) missing-only ou strict-remote-hash
  • syncDefault (string) fallback utilise pendant le sync init
  • normalizeUploads (boolean) normalise les images avant upload Discord (defaut false)
  • normalizeSize (number) taille cible de normalisation (defaut 128)
  • normalizeFormat (string) format cible png|webp|jpeg (defaut png)
  • normalizeCacheDir (string) dossier disque pour stocker les images converties (defaut ./emojis/.discord-cache)
  • log (boolean) active les logs du module
  • logLevels (string[]) filtre par niveau (debug/info/warn/error)
  • logEvents (string[]) filtre par type d'event (create, update, delete, etc.)
  • logger (objet type console) optionnel

Reparer des emojis renommes / inverses

Si les noms existent encore sur le bot mais pointent vers le mauvais visuel, utilise:

const emoji = await createEmojiModule({
  client,
  emojiDir: './emojis',
  syncOnInit: true,
  syncOnInitMode: 'update-all',
  updateStrategy: 'strict-remote-hash',
  syncConcurrency: 8,
}).init();

Ce mode compare visuellement le local et le distant, puis recree l'emoji si le contenu ne correspond pas.

Quand normalizeUploads est active, le module cree aussi un cache disque des images converties dans .discord-cache pour eviter les reconversions et reduire la latence.

Structure

Le code est decoupe dans src/fonction/ avec 1 responsabilite par fichier.