New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

discord-ping

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-ping

Simple ping package for discord.js

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Installation

npm install discord-ping

Usage

const discord = require('discord.js')
const client = new discord.Client()
const { Ping } = require('discord-ping')
const ping = new Ping()
const prefix = '/'

client.once('ready', () => {
    console.log('Ready')
})

client.on('message', async message => {
    if(message.content.startsWith(`${prefix}ping`))
    ping.message(message)
})

client.login(YOUR_TOKEN_HERE)




All Features

To setup the basic version of discord-ping follow the code below.

client.on('message', message => {
    if(!message.content.startsWith(prefix) || message.author.bot) return
    if(message.content.startsWith(`${prefix}ping`)) // Replace ping with whatever you want
    ping.message(message)
})

This setup includes both the Bot Ping and the API Ping




Bot Ping Setup

To setup the Bot Ping version of discord-ping follow the code below

client.on('message', message => {
    if(!message.content.startsWith(prefix) || message.author.bot) return
    if(message.content.startsWith(`${prefix}ping`)) // Replace ping with whatever you want
    ping.Botping(message)
})

This setup only includes Bot Ping




API Ping Setup

To setup the API Ping version of discord-ping follow the code below

client.on('message', message => {
    if(!message.content.startsWith(prefix) || message.author.bot) return
    if(message.content.startsWith(`${prefix}ping`)) // Replace ping with whatever you want
    ping.APIping(message)
})

More

Want to use all the features? Take a look at our ducumentation.



Change Log

3/25/21 1:50 PM
Updated the README file to make it look nice
3/27/21 2:00 AM
Added the 2 extra features and added the instructions to the README file.
3/27/21 1:14 PM
Minor bug fixes

Keywords

discord

FAQs

Package last updated on 27 Mar 2021

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