amtixdev-morse-code

1.1.5 • Public • Published

amtixdev-morse-code

Discord server NPM version NPM downloads

AmtiXDev

Examples/How Package amtixdev-morse-code Work?

How To Install Package?

npm install amtixdev-morse-code

How To Use Package

const { textToMorse, morseToText } = require('amtixdev-morse-code');

client.on('messageCreate', (message) => {
  if (message.author.bot) return; // Ignore messages from other bots

  const args = message.content.split(' ');
  const command = args[0].toLowerCase();

  if (command === '!morse') {
    // Convert text to Morse code
    const text = args.slice(1).join(' ');
    const morse = textToMorse(text);
    message.channel.send(`Morse code: ${morse}`);
  }

  if (command === '!decode') {
    // Decode Morse code to text
    const morse = args.slice(1).join(' ');
    const text = morseToText(morse);
    message.channel.send(`Decoded message: ${text}`);
  }
});

By AmtiXDev

Image

If You Need Help About How The Npm Package Work? Contant Me HERE

CopyRight ©

All rights reserved to AmtiXDev

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i amtixdev-morse-code

      Weekly Downloads

      6

      Version

      1.1.5

      License

      ISC

      Unpacked Size

      4.42 kB

      Total Files

      3

      Last publish

      Collaborators

      • amtixdev