is-discord-invitation
v1.0.13
Published
Checks if a string is an official Discord invitation link
Downloads
95
Maintainers
Readme
is-discord-invitation
- NPM package that checks if a string is an official Discord invitation link
- Useful when creating bots and you want to detect easily if the message sent by the user is an invitation to another Discord server.
Install NPM
$ npm i is-discord-invitation
Usage
- Returns a Boolean indicating whether
string
is a Discord invitation link - It will return
false
if thestring
is empty or if it isn't an invitation link
Examples
const isDiscordInvitation = require("is-discord-invitation");
if (isDiscordInvitation("https://discord.gg/J4bbax")) {
console.log("Hey, no spamming with invites please 😡");
}