amtixdev-morse-code
v1.1.5
Published
Discord Fun Morse Code For Discord Bots
Downloads
17
Readme
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
If You Need Help About How The Npm Package Work? Contant Me HERE
CopyRight ©
All rights reserved to AmtiXDev