Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accepting Suggestions #31

Open
MrAugu opened this issue Apr 3, 2021 · 24 comments
Open

Accepting Suggestions #31

MrAugu opened this issue Apr 3, 2021 · 24 comments
Assignees
Labels
enhancement New feature or request

Comments

@MrAugu
Copy link
Owner

MrAugu commented Apr 3, 2021

Is there anything you would like to see added to discord-xp module? If yes, then state any suggestions in this issue.

@MrAugu MrAugu added the enhancement New feature or request label Apr 3, 2021
@MrAugu MrAugu self-assigned this Apr 3, 2021
@MrAugu MrAugu pinned this issue Apr 3, 2021
@AdamTmHun
Copy link

Types for typescript

@MrAugu
Copy link
Owner Author

MrAugu commented Apr 3, 2021

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).

@AdamTmHun
Copy link

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.

@felixsu7
Copy link

felixsu7 commented Apr 7, 2021

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

@Dragonizedpizza
Copy link

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

@naruko-hstk
Copy link

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

@AdamTmHun
Copy link

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

@Myst82015
Copy link
Collaborator

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.

@Myst82015
Copy link
Collaborator

@Dragonizedpizza Go ahead and create a pull request.

@AdamTmHun
Copy link

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

@NamanPrakash
Copy link

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

@Myst82015
Copy link
Collaborator

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

@Dragonizedpizza
Copy link

@Dragonizedpizza Go ahead and create a pull request.

Gonna work on it rn

@Dragonizedpizza
Copy link

@Myst82015
@AdamTmHun
#35

@NamanPrakash
Copy link

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

@PrabhasDaily
Copy link

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 :)

@Dragonizedpizza
Copy link

both of those can be done yourself though

@PrabhasDaily
Copy link

how?

@Dragonizedpizza
Copy link

how?

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

@Only-Moon
Copy link

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

@Myst82015
Copy link
Collaborator

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.

@Only-Moon
Copy link

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

@PrabhasDaily
Copy link

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

@Dragonizedpizza
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants