Skip to content

LvckyWorld/marina-api-sdk

Repository files navigation

Marina API SDK

Latest Release
Banner
Docs

Website Discord
The official MarinaAPI as NPM-Package

Install the Package

First you need to install the package using npm

npm install @lvckyworld/marina-api

Import the Package

TypeScript

import {MarinaAPI} from "@lvckyworld/marina-api"

JavaScript

const {MarinaAPI} = require("@lvckyworld/marina-api");

Usage Example

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);
        }
    }
}

About

The official MarinaAPI as NPM-Package. This repository is mirrored from:

Resources

Stars

Watchers

Forks

Packages

No packages published