TextTicketManager#

The text ticket manager class.

Constructor#

new TextTicketManager(client, options)#

The constructor of the text ticket manager class.

Parameters:
NameTypeDescription
clientClient

The client

optionsTextTicketManagerOptions

The options of the text ticket manager

Extends#

Members#

cache :Collection.<Number, TextTicket>#

The cache with all text tickets

Type:

client :Client#

The client

Type:
  • Client

isReady :Boolean#

If the tickets are loaded.

Type:
  • Boolean

options :TextTicketManagerOptions#

The options of the text ticket manager

Methods#

checkDoubleTickets(guildId, userId) → {Promise.<Boolean>}#

Checks if a user has multiple tickets

Parameters:
NameTypeDescription
guildIdSnowflake

The id of the guild

userIdSnowflake

The id of the user

Returns:
Type: 
Promise.<Boolean>

closeTicket(ticket) → {Promise.<(TextTicket|DisGroupDevError)>}#

Closes a ticket

Parameters:
NameTypeDescription
ticketTextTicket

The text ticket you want to close

Returns:
Type: 
Promise.<(TextTicket|DisGroupDevError)>

createTicket(guild, user) → {Promise.<(TextTicket|DisGroupDevError)>}#

Creates a ticket for a user

Parameters:
NameTypeDescription
guildGuildResolvable

The guild of the ticket

userUserResolvable

The user who created the ticket

Returns:
Type: 
Promise.<(TextTicket|DisGroupDevError)>

deleteTicket(ticket) → {Promise.<(Boolean|DisGroupDevError)>}#

Deletes a ticket

Parameters:
NameTypeDescription
ticketTextTicket

The ticket to delete

Returns:
Type: 
Promise.<(Boolean|DisGroupDevError)>

renameTicket(ticket, name) → {Promise.<(TextTicket|DisGroupDevError)>}#

Renames a ticket

Parameters:
NameTypeDescription
ticketTextTicket

The ticket to rename

nameString

The new name of the ticket

Returns:
Type: 
Promise.<(TextTicket|DisGroupDevError)>

reopenTicket(ticket) → {Promise.<(TextTicket|DisGroupDevError)>}#

Reopens a ticket

Parameters:
NameTypeDescription
ticketTextTicket

The ticket to reopen

Returns:
Type: 
Promise.<(TextTicket|DisGroupDevError)>

resolveGuild(guild) → {Guild|null}#

Resolves a guild

Parameters:
NameTypeDescription
guildGuildResolvable

The guild to resolve

Returns:
Type: 
Guild | null

resolveUser(user) → {User|null}#

Resolves a user

Parameters:
NameTypeDescription
userUserResolvable

The user to resolve

Returns:
Type: 
User | null

save() → {Boolean|DisGroupDevError}#

Saves the ticket to the json file

Returns:
Type: 
Boolean | DisGroupDevError

Events#

ticketClose#

Emitted when a ticket is closed

Parameters:
NameTypeDescription
ticketTextTicket

ticketCreate#

Emitted when a ticket is created

Parameters:
NameTypeDescription
ticketTextTicket

ticketDelete#

Emitted when a ticket is deleted

Parameters:
NameTypeDescription
ticketTextTicket

ticketRename#

Emitted when a ticket is renamed

Parameters:
NameTypeDescription
ticketTextTicket

ticketReopen#

Emitted when a ticket is reopened

Parameters:
NameTypeDescription
ticketTextTicket