Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord-tool

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-tool

A best tool for discord bot

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

npm npm

Need help? Contact me on Discord.

Installation

npm i --save discord-tool
yarn add discord-tool

AntiCrash

const { AntiCrash } = require('discord-tool'); // CJS
import { AntiCrash } from 'discord-tool'; // ESM

new AntiCrash(client /* Discord.Client */);

// Tips:
/*
You can use this to prevent your bot from crashing. In short, the bot does not shut down when it gives an error.
*/

Message Deleter

const { DeleteMessage } = require('discord-tool'); // CJS
import { DeleteMessage } from 'discord-tool'; // ESM

await channel.send('dpr').then(msg => DeleteMessage(message /* Discord.Message */, 4000));

Advanced Message Finder

const { MessageFinder } = require('discord-tool'); // CJS
import { MessageFinder } from 'discord-tool'; // ESM

await MessageFinder(message /* Discord.Message */, 'content', { limit: 10, caseSensitive: true, include: true });

// Tips:
/*
if include is false, it will return the message that doesn't include the content.
if caseSensitive is false, it will return the message that doesn't include the content with case insensitive.
*/

Get User Flags

const { GetFlags } = require('discord-tool'); // CJS
import { GetFlags } from 'discord-tool'; // ESM

GetFlags(message.author.flags /* Discord.UserFlagsBitField | null */);

// Output: [ 'HypeSquadOnlineHouse3', 'ActiveDeveloper' ]

Random

const { Random } = require('discord-tool'); // CJS
import { Random } from 'discord-tool'; // ESM

Random.number(1 /* Min */, 10 /* Max */); // Output: 5
Random.array(['l', 'o', 'i', 'r', 'e', 'n']); // Output: 'i'

Match Emojis

const { MatchEmojis } = require('discord-tool'); // CJS
import { MatchEmojis } from 'discord-tool'; // ESM

MatchEmojis('developed by loiren 👍 <a:nice_emoji:1171093533831200798>'); // Output: ['👍', '<a:nice_emoji:1171093533831200798>']

Check URL Validity

const { CheckURL } = require('discord-tool'); // CJS
import { CheckURL } from 'discord-tool'; // ESM

CheckURL('https://loiren.now.sh'); // Output: true
CheckURL('loiren'); // Output: false

Check Invite URL Validity

const { CheckInvite } = require('discord-tool'); // CJS
import { CheckInvite } from 'discord-tool'; // ESM

CheckInvite('https://discord.gg/partnerbot'); // Output: true
CheckInvite('https://loiren.now.sh'); // Output: false

Colors

const { Colors } = require('discord-tool'); // CJS
import { Colors } from 'discord-tool'; // ESM

Colors.Blank // This is a blank color.
Developed with 💙 by Loiren
This package was developed 1 year ago.

Keywords

FAQs

Package last updated on 21 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc