Giter VIP home page Giter VIP logo

Comments (24)

Dragonizedpizza avatar Dragonizedpizza commented on August 27, 2024 2

Can I help rewrite a new version of discord-xp, wherein you could do:

(require('discord-xp')).setDB('quick.db', quickdb)
// quickdb is the quick.db database.
// basically what I mean is support multiple databases

Instead of the static async setURL function, you could use this:

  static async setDB(dbname, db) {
  const databases = ['quick.db', 'mongoose']
  if (!databases.includes(dbname)) throw new TypeError(`Provided database (${dbname}) is not valid.`)
  if (database.includes('mongoose')) {
      mongoUrl = dbUrl;
    return mongoose.connect(dbUrl, {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      useFindAndModify: false
    });
    }
  }

from discord-xp.

AdamTmHun avatar AdamTmHun commented on August 27, 2024

Types for typescript

from discord-xp.

MrAugu avatar MrAugu commented on August 27, 2024

Types for typescript

That was implemented today, several minutes ago with the new version v1.1.11. Check the instructions in the README.md on how to update (https://npmjs.org/discord-xp).

from discord-xp.

AdamTmHun avatar AdamTmHun commented on August 27, 2024

Types for typescript

That was implemented today, several minutes ago with the new version v1.1.11. Check the instructions in the README.md on how to update (https://npmjs.org/discord-xp).

O minutes ago, okay thanks.

from discord-xp.

felixsu7 avatar felixsu7 commented on August 27, 2024

I think it would be nice if there's event emitters, for example the library would emit an event when someone leveled up or down

from discord-xp.

naruko-hstk avatar naruko-hstk commented on August 27, 2024

Maybe can let it using mysql or mariadb
Not everyone use mongo

from discord-xp.

AdamTmHun avatar AdamTmHun commented on August 27, 2024

Can I help rewrite a new version of discord-xp, wherein you could do:

(require('discord-xp')).setDB('quick.db', quickdb)
// quickdb is the quick.db database.
// basically what I mean is support multiple databases

Instead of the static async setURL function, you could use this:

  static async setDB(dbname, db) {
  const databases = ['quick.db', 'mongoose']
  if (!databases.includes(dbname)) throw new TypeError(`Provided database (${dbname}) is not valid.`)
  if (database.includes('mongoose')) {
      mongoUrl = dbUrl;
    return mongoose.connect(dbUrl, {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      useFindAndModify: false
    });
    }
  }

I was going to suggest the same. Add quick-db / simple json or sqlite support, via other databases

from discord-xp.

Myst82015 avatar Myst82015 commented on August 27, 2024

Can I help rewrite a new version of discord-xp, wherein you could do:

(require('discord-xp')).setDB('quick.db', quickdb)
// quickdb is the quick.db database.
// basically what I mean is support multiple databases

Instead of the static async setURL function, you could use this:

  static async setDB(dbname, db) {
  const databases = ['quick.db', 'mongoose']
  if (!databases.includes(dbname)) throw new TypeError(`Provided database (${dbname}) is not valid.`)
  if (database.includes('mongoose')) {
      mongoUrl = dbUrl;
    return mongoose.connect(dbUrl, {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      useFindAndModify: false
    });
    }
  }

I was going to suggest the same. Add quick-db / simple json or sqlite support, via other databases

MrAugu will add support for different storage providers including json if I recall that correctly.

from discord-xp.

Myst82015 avatar Myst82015 commented on August 27, 2024

@Dragonizedpizza Go ahead and create a pull request.

from discord-xp.

AdamTmHun avatar AdamTmHun commented on August 27, 2024

Can I help rewrite a new version of discord-xp, wherein you could do:

(require('discord-xp')).setDB('quick.db', quickdb)
// quickdb is the quick.db database.
// basically what I mean is support multiple databases

Instead of the static async setURL function, you could use this:

  static async setDB(dbname, db) {
  const databases = ['quick.db', 'mongoose']
  if (!databases.includes(dbname)) throw new TypeError(`Provided database (${dbname}) is not valid.`)
  if (database.includes('mongoose')) {
      mongoUrl = dbUrl;
    return mongoose.connect(dbUrl, {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      useFindAndModify: false
    });
    }
  }

I was going to suggest the same. Add quick-db / simple json or sqlite support, via other databases

MrAugu will add support for different storage providers including json if I recall that correctly.

Alright cool

from discord-xp.

NamanPrakash avatar NamanPrakash commented on August 27, 2024

I think you should make an function like
giving the rank of the user instead of fetching all the leaderboard you could simply do this

user.rank()
// gives the rank of the user

from discord-xp.

Myst82015 avatar Myst82015 commented on August 27, 2024

I think you should make an function like
giving the rank of the user instead of fetching all the leaderboard you could simply do this

user.rank()
// gives the rank of the user

First of all you'll always need to sort through the entries to get the rank/ position.
Second the fetch() has been updated and now takes a third boolean parameter called fetchPosition. If you enable that then

console.log(<user>.position);   // Position of the user

from discord-xp.

Dragonizedpizza avatar Dragonizedpizza commented on August 27, 2024

@Dragonizedpizza Go ahead and create a pull request.

Gonna work on it rn

from discord-xp.

Dragonizedpizza avatar Dragonizedpizza commented on August 27, 2024

@Myst82015
@AdamTmHun
#35

from discord-xp.

NamanPrakash avatar NamanPrakash commented on August 27, 2024

I think you should make an function like
giving the rank of the user instead of fetching all the leaderboard you could simply do this

user.rank()
// gives the rank of the user

First of all you'll always need to sort through the entries to get the rank/ position.
Second the fetch() has been updated and now takes a third boolean parameter called fetchPosition. If you enable that then

console.log(<user>.position);   // Position of the user

The fetchPosition is the same as

user.rank()

so my wish has been granted

from discord-xp.

PrabhasDaily avatar PrabhasDaily commented on August 27, 2024

allow us to add roles (eg. user reaches level 5 and gets the role "level 5") and make it so that
users can change the background of their rank card :)

from discord-xp.

Dragonizedpizza avatar Dragonizedpizza commented on August 27, 2024

both of those can be done yourself though

from discord-xp.

PrabhasDaily avatar PrabhasDaily commented on August 27, 2024

how?

from discord-xp.

Dragonizedpizza avatar Dragonizedpizza commented on August 27, 2024

how?

just check if the level the user got to is level 5, and discord-xp doesn't provide the rank card itself

from discord-xp.

Xx-Mohit-xX avatar Xx-Mohit-xX commented on August 27, 2024

Maybe update the examples so the code can run in discord.js v13 as well

from discord-xp.

Myst82015 avatar Myst82015 commented on August 27, 2024

Maybe update the examples so the code can run in discord.js v13 as well

I'll take a look as soon as I have some free time.

from discord-xp.

Xx-Mohit-xX avatar Xx-Mohit-xX commented on August 27, 2024

Maybe update the examples so the code can run in discord.js v13 as well

I'll take a look as soon as I have some free time.

Alr tysm, take a look at that .setStatus(..) part for canvas as well, if member is offline, then canvas says .setStatus cannot be null

from discord-xp.

PrabhasDaily avatar PrabhasDaily commented on August 27, 2024

how can i check if a user is level 5 or 6 and give them a role from the bot?

from discord-xp.

Dragonizedpizza avatar Dragonizedpizza commented on August 27, 2024

how can i check if a user is level 5 or 6 and give them a role from the bot?

this is meant for suggestions, not support

from discord-xp.

Related Issues (20)

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.