1.0.4 • Published 3 years ago

discord-ping v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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

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

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

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