Members

(constant) ErrorCodes :DXPlusErrorCodes

Methods

capitalize(string) → {String}

Capitalize a string
Parameters:
NameTypeDescription
stringStringString to capitalize
Returns:
- Capitalized string
Type: 
String

isNotPositiveInteger(value) → {Boolean}

Validates if a value is a positive integer.
Parameters:
NameTypeDescription
valueNumberValue to validate.
Returns:
Type: 
Boolean

Type Definitions

Achievement

Type:
  • Object
Properties
NameTypeAttributesDescription
nameStringThe name of the achievement.
descriptionStringThe description of the achievement.
thumbnailString | undefined<optional>
The thumbnail of the achievement.
rewardNumberThe reward of the achievement.
typeAchievementTypeThe type of the achievement.
progressArray.<Number>The progress of the achievement.

AchievementData

AchievementStatus

Type:
  • Object
Properties
NameTypeDescription
LockedNumberThe achievement is locked.
UnlockedNumberThe achievement is unlocked.

AchievementType

Type:
  • Object
Properties
NameTypeDescription
ProgressiveNumberThe achievement is progressive (example: x messages sended).
OneTimeNumberThe achievement is one time only (example: first message).

DXPlusErrorCodes

Type:
  • Object
Properties
NameTypeDescription
RankPriorityUsed'RankPriorityUsed'The priority of the rank is already used by another rank.
RankNotFound'RankNotFound'The rank was not found in the guild.
AchievementInvalidProgress'AchievementInvalidProgress'The progress of the achievement is not valid.
AchievementNegativeProgress'AchievementNegativeProgress'The progress of the achievement is negative.
AchievementGraterProgress'AchievementGraterProgress'The first element of the progress array must be less than the second element.
DuplicatedAchievement'DuplicatedAchievement'The achievement is already in the guild.
AchievementNotFound'AchievementNotFound'The achievement was not found in the guild.
BuilderInvalidNumber'BuilderInvalidNumber'The number must be a positive integer.
EventMissingProperty'EventMissingProperty'The event must have the required property.
InvalidValue'InvalidValue'The value of the property is not valid.
InvalidDataArgument'InvalidDataArgument'The data argument must be a object.
MissingArgument'MissingArgument'The argument is missing.
MissingProperty'MissingProperty'The property is missing.

DatabaseData

Type:
  • Object
Properties
NameTypeDescription
guildIdDiscord.SnowflakeThe id of the guild.
ranksArray.<Rank>The ranks of the guild.
achievementsArray.<Achievement>The achievements of the guild.
usersArray.<UserEntry>The users of the guild.

GuildData

LeaderboardOptions

Type:
  • Object
Properties
NameTypeAttributesDefaultDescription
guildIdDiscord.Snowflake<optional>
'global'The id of the guild.
limitNumber<optional>
10The limit of the leaderboard.

LevelManagerEvents

Type:
  • Object
Properties
NameTypeDescription
ManagerReadyStringThe manager is ready.
XpAddedStringThe user has added xp.
LevelUpStringThe user has leveled up.
LevelDownStringThe user has leveled down.
DegradeLevelStringThe user has degraded level.
RankUpStringThe user has ranked up.
RankDownStringThe user has ranked down.
DegradeRankStringThe user has degraded rank.

LevelManagerOptions

Type:
  • Object
Properties
NameTypeAttributesDefaultDescription
mongoUriStringThe uri of the mongo database.
ranksArray.<Rank> | Array.<RankBuilder> | undefined<optional>
The general ranks that will be used in every guild (default in Options class).
achievementsArray.<Achievement> | Array.<AchievementBuilder> | undefined<optional>
The general achievements that will be used in every guild (default in Options class).
maxXpToLevelUpNumber | undefined<optional>
2500The max xp to level up (only works for the first level then it will be calculated with calculateXpToLevelUp function).
saveIntervalNumber | undefined<optional>
1000 * 60 * 60 * 3The interval to save the data in the database (in milliseconds).
autoSaveBoolean | undefined<optional>
trueIf the data will be saved automatically.
eventsPathString | undefined<optional>
The path to the events folder.

Rank

Type:
  • Object
Properties
NameTypeDescription
nameplateStringThe nameplate of the rank.
colorDiscord.ColorResolvable | StringThe color accent of the rank.
priorityNumberThe priority of the rank.
minNumberThe minimum level of the rank.
maxNumberThe maximum level of the rank.

RankData

Type:

UserEntry

Type:
  • Object
Properties
NameTypeDescription
idDiscord.SnowflakeThe id of the user.
xpNumberThe xp of the user.
levelNumberThe level of the user.
maxXpToLevelUpNumberThe max xp to level up.
rankRankThe rank of the user.
achievementsArray.<Achievement>The achievements of the user.