discord-ticket-easy
Version:
- A module allowing the simple creation of a discord ticket with your client supported by Discord.js^14.0.0 - The easiest to use ticket module.
82 lines (51 loc) • 2.34 kB
Markdown
- A module allowing the simple creation of a discord ticket with your client supported by Discord.js^14.0.0
- The easiest to use ticket module.
- nothing for the moment
[](https://npmjs.org/discord-ticket-easy)
[](https://npmjs.org/package/discord-ticket-easy)
```js
(index.js)
const { Client } = require("discord-ticket-easy");
Client.setApiKey("<your-api-key>")
```
```js
const { Setup } = require("discord-ticket-easy");
const Discord = require("discord.js");
const intents = new Discord.IntentsBitField(3276799);
const client = new Discord.Client({intents});
client.on("ready", () => {
console.log("I'm login !")
});
client.on("interactionCreate", async (interaction) => {
if (interaction.isChatInputCommand() && interaction.commandName === 'tsetup') {
let manager = new Setup(bot, {
interaction: interaction
})
manager.setupMessageTicket()
}
});
```
⚠️ The interaction handler must be placed either in a Client.on function which takes "interactionCreate" as a parameter or in a file defined by your bot which retrieves this same parameter. If you enter the handler in a Client.on which supports the "interactionCreate" event and which itself is in a file containing this last parameter, then the handler will not work.
In the example below, the manager is only in the client.on which supports the "interactionCreate" event.
```js
const { Interaction } = require("discord-ticket-easy");
const Discord = require("discord.js");
const intents = new Discord.IntentsBitField(3276799);
const client = new Discord.Client({intents});
client.on("ready", () => {
console.log("I'm login !")
});
client.on("interactionCreate", async (interaction) => {
new Interaction(client, interaction).start()
})
```
To contact the owner of this module, you can join his [discord server](discord.gg/DXbpKPk6FX) and ask him a question.\
For anything else, ditto, join his [discord server](discord.gg/DXbpKPk6FX).
*(careful, this discord server is on french!)*