Socket
Socket
Sign inDemoInstall

@dramaorg/magnam-iure

Package Overview
Dependencies
74
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @dramaorg/magnam-iure

![banner](https://i.ibb.co/3dChy9y/cooltext441822979190041.png)


Version published
Weekly downloads
266
decreased by-19.39%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

banner

An easy to use PikaNetwork API wrapper.

npm package Downloads Issues

About

@dramaorg/magnam-iure is a NodeJS module which allows you to interact with the PikaNetwork API easily.

  • Written in JavaScript
  • Frequently updated
  • 100% coverage of PikaNetwork API

Installation

Node.js 14+ or newer is required

npm install @dramaorg/magnam-iure
yarn add @dramaorg/magnam-iure
pnpm add @dramaorg/magnam-iure

Usage

Profile

const { Profile } = require("@dramaorg/magnam-iure");

async function fetchProfile() {
  const playerIGN = "PikaNetwork";
  const profile = new Profile(playerIGN);

  try {
    const ranks = await profile.getRankInfo(); // Get information about the player's ranks.
    const levelling = await profile.getLevellingInfo(); // Get information about the player's network level and rank.
    const guild = await profile.getGuildInfo(); // Guild information about the player's guild.
    const friends = await profile.getFriendList(); // Get a list of friends the player has.
    const joinInfo = await profile.getJoinInfo(); // Get information about the player's estimated first join and last join.
    const miscInfo = await profile.getMiscInfo(); // Get other miscellaneous information.
  } catch (error) {
    console.error("Error fetching data:", error);
  }
}

fetchProfile();

Punishments

const { Punishments } = require("@dramaorg/magnam-iure");

async function fetchPunishments() {
  const playerIGN = "MrFrenco";
  const punishment = new Punishments(playerIGN);

  try {
    const punishments = await punishment.getPunishments(); // Get a list of all of the player's punishments.
    const issued = await punishment.getIssuedPunishments(); // Get a list of punishments issued by this player.
  } catch (error) {
    console.error("Error fetching punishments:", error);
  }
}

fetchPunishments();

Player Leaderboard

const { PlayerLeaderboard } = require("@dramaorg/magnam-iure");

async function fetchPlayerLeaderboard() {
  const playerIGN = "PikaNetwork";
  const interval = "total"; // total, monthly, weekly.
  const mode = "ALL_MODES"; // ALL_MODES, SOLO, DOUBLES, TRIPLES, QUAD.
  const gamemode = "bedwars";
  // bedwars, skywars, rankedpractice, unrankedpractice, kitpvp,
  // classicskyblock, survival, lifesteal, opskyblock, oplifesteal
  // opfactions, opprison. These are all options for gamemode.
  const playerLeaderboard = new PlayerLeaderboard(playerIGN, interval, mode, gamemode);

  try {
    const leaderboard = await playerLeaderboard.getLeaderboardData(); // Get the player's leaderboard based on set parameters.
    const kdr = await playerLeaderboard.getKDR(); // Get the player's kill/death ratio.
    const fkdr = await playerLeaderboard.getFKDR(); // Get the player's final kill/final death ratio.
    const wlr = await playerLeaderboard.getWLR(); // Get the player's win/loss ratio.
  } catch (error) {
    console.error("Error fetching data:", error);
  }
}

fetchPlayerLeaderboard();

Total Leaderboard

const { TotalLeaderboard } = require("@dramaorg/magnam-iure");

async function fetchTotalLeaderboard() {
  const interval = "total"; // total, monthly, weekly.
  const mode = "ALL_MODES"; // ALL_MODES, SOLO, DOUBLES, TRIPLES, QUAD.
  const stat = "wins"; // Too many to be listed (varies from game to game).
  const gamemode = "bedwars";
  // bedwars, skywars, rankedpractice, unrankedpractice, kitpvp,
  // classicskyblock, survival, lifesteal, opskyblock, oplifesteal
  // opfactions, opprison. These are all options for gamemode.
  const offset = "0";
  const limit = "25";
  // The offset is at which postion the leaderboard starts (0 = #1 is the first).
  // The limit is upto how many players will be shown, the limit is capped at 25.
  const totalLeaderboard = new TotalLeaderboard(interval, mode, stat, offset, limit, gamemode);
  try {
    const leaderboard = await totalLeaderboard.fetchLeaderboardData(); // Get the total leaderboard based on set parameters.
  } catch (error) {
    console.error("Error fetching data:", error);
  }
}

fetchTotalLeaderboard();

Staff

const { Staff } = require("@dramaorg/magnam-iure");

async function fetchStaffList() {
  try {
    const staff = new Staff();
    const list = await staff.getStaffList();
    console.log(list);
  } catch (error) {
    console.error("Error fetching data:", error);
  }
}

fetchStaffList();

Contributing

Contributions are welcome! If you have any suggestions or issues, please open an issue or pull request.

License

This project is licensed under the MIT License. See the LICENSE.

Help

If you're having issues with a method, or the wrapper isn't working as expected, you can DM tejaslamba or mrspeedy35 on Discord.

Acknowledgements

Please note that the data given out by our code belongs to PikaNetwork.

Keywords

FAQs

Last updated on 19 Jun 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc