1.0.2 • Published 2 years ago

@disgroupdev/discord-tickets v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@disgroupdev/discord-tickets

About

@disgroupdev/discord-tickets powerful DiscordJS Module which allows you to create support tickets in your Discord-Servers.

  • Class-oriented
  • Object-oriented
  • Performant

Installation

Node.js 16.9.0 or newer is required.

npm install @disgroupdev/discord-tickets discord.js

Examples

Init Ticket Manager:

const { Client } = require('discord.js');
const { GuildTextTicketManager } = require('@disgroupdev/discord-tickets');


client.on('ready', () => {

  client.tickets = new GuildTextTicketManager(client, client.guilds.cache.get("guildId"), {

    channelTopic: "Welcome to the Ticket-Support", // The default channel topic
    closedParentId: "categoryId", // The ID of the category for closed tickets
    enabled: true, // Enables the Ticket Manager
    openParentId: "categoryId", // The ID of the category for open tickets
    staffRoles: ['719506936810438667'], // A list of all role IDs which will have staff permissions in the tickets
    storage: "./Assets/json/tickets.json", // The JSON file where all tickets will be stored
    ticketCache: true // Allowes the manager to create cache

});

});

Close Ticket:

await client.tickets.close(ticket);
// or
await ticket.close();

Create Ticket:

await client.tickets.create(guild, member);

Delete Ticket:

await client.tickets.delete(ticket);
// or
ticket.delete();

Get Ticket:

const ticket = client.tickets.tickets.get('channelId'); // Only avaiable if GuildTextTicketManager.options#ticketCache is enabled

Reopen ticket:

await client.tickets.reopen(ticket);
// or
ticket.reopen();

🔗 Links

Made with 💙 by DisGroup Development