Git Product home page Git Product logo

mee6-levels-api's Introduction

mee6-levels-api

An unofficial API wrapper for the Mee6 levels plugin.

Note

While this package works (at the time of writing this), it is neither developed nor officially supported by the Mee6 team. The API route used here is undocumented and is subject to change at any point of time.

Please do not ask for support for this package at the Mee6 Support server. Instead, you may message me directly at rjt#2336 or open an issue here for any concerns related to this package.

Installation

Install from npm as follows:

npm install mee6-levels-api

Usage

const Mee6LevelsApi = require("mee6-levels-api");

const guildId = "159962941502783488"; // or a Guild object with the id property
const userId = "258258856189231104"; // or a User object with the id property

Mee6LevelsApi.getLeaderboardPage(guildId).then(leaderboard => {
	// do something with leaderboard
	console.log(`${leaderboard.length} members ranked on the leaderboard.`);
});

Mee6LevelsApi.getRoleRewards(guildId).then(rewards => {
	// do something with rewards
	for (const reward of rewards)
		console.log(`${reward.role.name} - Given at level ${reward.level}`);
});

Mee6LevelsApi.getUserXp(guildId, userId).then(user => {
	// do something with user info
	console.log(`${user.tag} is at level ${user.level} and rank ${user.rank}.`);
});

Configuration

Open the leaderboard settings in the MEE6 dashboard and enable the option: Make my server's leaderboard public. It is not possible to fetch data from the dashboard if this option is not enabled and the error 'Response code 401' will be returned.

mee6-levels-api's People

Contributors

lioness100 avatar rhomita avatar rjt-rockx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mee6-levels-api's Issues

Please bump got to new version

Hope you take some minutes to bump got to the new version. Thank you very much for your awesome work. It'd have saved my personal discord bot

Api not working

Hey, i'm using the api in my discord bot to get the levels from mee6 and set rolls.
the bot is working fine so far to set rolls aso.
as soon as i import the api the bot will not start anymore giving the following error:
`internal/util.js:214
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function');
^

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
at Object.promisify (internal/util.js:214:11)
at Object. (/home/nicobot/node_modules/got/dist/source/get-response.js:8:25)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/home/nicobot/node_modules/got/dist/source/request-as-event-emitter.js:13:24)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/home/nicobot/node_modules/got/dist/source/as-promise.js:9:36)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
`
Is there anything i am missing?

API is no longer working

The API will no longer work, my guess is that they made it private access.

/home/dubfib/Programming/idk/node_modules/got/dist/source/as-promise.js:118
                const error = new errors_1.HTTPError(response, options);
                              ^

HTTPError: Response code 401 (Unauthorized)
    at EventEmitter.<anonymous> (/home/dubfib/Programming/idk/node_modules/got/dist/source/as-promise.js:118:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
const mee6 = require("mee6-levels-api");

module.exports = async function MessageCommand(client, message, args) {
    mee6.getUserXp(message.guild.id, message.author.id).then(user => {
        const tag = user.tag;
        const level = user.level;
        const rank = user.rank;
        message.reply(`You are ${tag}, your level is ${level} and your rank is ${rank}`);
    });
};

I also tried visiting it with my browser, it didn't work at all.

How to get level of user?

I am wondering if I can get the levels of user from mee6 because I am planning to automate the rewards in one server I own

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.