npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

djs-tickets-v2

v2.0.2

Published

Create support tickets discord.js with low effort and easy to use

Downloads

13

Readme

Useful Links

  • If there are any issues contact me [LEFT]Lejhand#9693 on discord
  • Inspired by discord_ticket_maker package

How to use

npm i djs-tickets-v2

Initialization

const { DiscordTicketUpdated } = require('djs-tickets-v2')
const ticket = new DiscordTicketUpdated()

Functions

ticket.setRole(message, role) //SETS STAFF ROLE THAT GET PINGED WHEN NEW TICKET IS MADE
	
ticket.makeTicket(message, reason, "LMFAO") //MAKES A NEW TICKET
	
ticket.closeTicket(message, channel) //CLOSES AN EXISTING TICKET
	
ticket.msgTicketChannel(message, channel, args) //SEND MESSAGE TO THE TICKET
	
ticket.Category(message, ID) //SETS THE PARENT CATEGORY FOR A TICKET
	
ticket.editEmbed(message, args) //EDITS THE EMBED MESSAGE SENT DURING NEW TICKET
	
ticket.ticketAddUser(channel, user) //ADDS A USER TO THE TICKET

Examples

if (message.content.startsWith('/ticketrole')) {
        const role = message.mentions.roles.first()

        ticket.setRole(message, role)
}

if (message.content.startsWith('/tnew')) {
        const reason = message.content.slice(7)
 
        ticket.makeTicket(message, reason, "LMFAO")
    }
    if (message.content.startsWith('/tclose')) {
        const args = message.content.slice(6)
        const channel = message.mentions.channels.first() || message.guild.channels.cache.find(c => c.id == args || c.name == args) || message.channel
 
        ticket.closeTicket(message, channel)
    }
    if (message.content.startsWith('/tsend')) {
        const channel = message.mentions.channels.first()
        const args = message.content.slice(5)
 
        ticket.msgTicketChannel(message, channel, args)
    }
    if (message.content.startsWith('/tcategory')) {
        const ID = message.content.slice(9)
        ticket.Category(message, ID)
 
        message.channel.send(`Ticket Category has been set!`)
    }
    if (message.content.startsWith('/tembed')) {
        const args = message.content.slice(14)
 
        ticket.editEmbed(message, args)
    }
    if(message.content.startsWith(`/tadduser`)) {
        const channel = message.mentions.channels.first()
        const user = message.mentions.users.first()
 
        ticket.ticketAddUser(channel, user)
    }
    if (message.content === `/tid`) {
        const ID = await ticket.fetchChanID(message)
        message.channel.send(`This channels id is ${ID}`)
    }

Values/Syntax

if you are unsure of what values to change, or do not understand, copy from the example above!

setRole(message, role)
This sets the role that gets pinged every time a support ticket is created!

Replace "message" with your message value
Replace "role" with the role mention, or value
makeTicket(message, reason, options)
This creates a new support ticket in a guild

Replace "message" with your message value
Replace "reason" with your reason args value, reasons are optional!
Replace "options" with any string, to send the made ticket message in dms!
closeTicket(message, channel)
This closes a support ticket, even if the ticket's name was changed

Replace "message" with your message value
Replace "channel" with the channel value, best not to change from example, unless you know discord.js
msgTicketChannel(channel, args)
Note: this is very buggy at the moment, fixes coming soon!

Send a message to a ticket channel
Replace "channel" with your channel value
Replace "args" with your args value!
Category(message, ID)
Set the ticket category

Replace "message" with your message value
Replace "ID" with the category id
editEmbed(message, args)
Changes the first message, of the embed that is sent

Replace "message" with the message value
Replace "args" with the arguments or message you want to set
ticketAddUser(channel, user)
Adds someone to a ticket channel

Replace "channel" with the channel value
Replace "user" with the user value, or person to add
fetchChanID(message)
Fetches the current channels actual id, if the channel is a ticket channel

Replace "message" with your message value, for the channel