nyakase / is-discord-invite

This npm package will check a string is an invitation to the Discord server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🌍・What is that?・🌍

EN: This npm package will check a string is an invitation to the Discord server.
PL: Ten moduł npm sprawdza ciąg znaków, czy znajduję się w nim zaproszenie na serwer Discord.

npm downloads Issues Last commit Commit activity Code size

📥 » Installation

$ npm install is-discord-invite

🤔 » Explanation

Regex visualizer

📄 » Examples

const isInvite = require('is-discord-invite');

// Example 1
isInvite('https://discord.gg/BAtT5MZJ'); // true
isInvite('https://sefinek.net'); // false

// Example 2 for Discord.js: https://www.npmjs.com/package/discord.js
const url = 'https://discord.gg/h9Y6FjUR';

if (isInvite(url)) {
    interaction.reply('✅ This is an invitation!');
} else {
    interaction.reply('❎ This is not an invitation.');
}

🤝 » Help

Open new Issue on GitHub.

⭐ » Thank you

Give a star if you can on GitHub page.

About

This npm package will check a string is an invitation to the Discord server.

License:MIT License


Languages

Language:JavaScript 100.0%