ghostdevv / djs-ticketsystem

DJS-TicketSystem is an extension to discord.js designed to make creating "tickets" in discord servers easier
Other
7 stars 4 forks source link

TypeError: Cannot read property 'extend' of undefined #8

Closed Timtendo12 closed 3 years ago

Timtendo12 commented 3 years ago
C:\Users\Timsl\Documents\FarCryDiscordBot\node_modules\djs-ticketsystem\src\structures\guild.js:5
Structures.extend('Guild', Guild => {
           ^

TypeError: Cannot read property 'extend' of undefined
    at Object.<anonymous> (C:\Users\Timsl\Documents\FarCryDiscordBot\node_modules\djs-ticketsystem\src\structures\guild.js:5:12)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (C:\Users\Timsl\Documents\FarCryDiscordBot\node_modules\djs-ticketsystem\src\index.js:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)

I might be doing something wrong.

my index.js:

console.clear(); //for nodemon

const Client = require("./Structures/client.js");
const ticketSystem = require('djs-ticketsystem');
//const { Client, Intents } = require("./Structures/client.js");

const config = require("./data/config.json");
const Discord = require("discord.js");

const client = new Client();

client.start(config.token);

My modmail.js

const Command = require("../Structures/command.js");
const config = require("../data/config.json")

module.exports = new Command({
    name: "modmail",
    description: "Sends a modmail to mod.",

    async run(message, args, client) {
        if (config.turnOnModmail === "true"){
            if (message.channelId === config.botChannel) {
                message.guild.createTicket({ owner: message.author })
                    .catch(console.error);
            }
        }
    }});
ghostdevv commented 3 years ago

You have to use djs v12 @Timtendo12, made a issue here: #9 would be great if you can check it out and leave some feedback!