First you need to install the package using npm
npm install @lvckyworld/marina-api
import {MarinaAPI} from "@lvckyworld/marina-api"
const {MarinaAPI} = require("@lvckyworld/marina-api");
import {MarinaAPI} from "@lvckyworld/marina-api"; // added
import {Message} from "discord.js";
import {LeaveSeverPCommand} from "./module/LeaveSeverPCommand";
export class MessageListener {
public static async onMessage(message: Message) {
const prefix = ".";
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
const command = message.content.toLowerCase().slice(prefix.length).split(" ")[0];
const args = message.content.slice(prefix.length).split(" ").slice(1);
if (command === "leave") {
if (!await MarinaAPI.isLvckyWorldAdmin(message.author.id)) return; // added
new LeaveSeverPCommand().execute(message, args);
}
}
}