Members
(constant) ErrorCodes :DXPlusErrorCodes
Type:
- Source
Methods
capitalize(string) → {String}
Capitalize a string
Parameters:
Name | Type | Description |
---|---|---|
string | String | String to capitalize |
- Source
Returns:
- Capitalized string
- Type:
- String
isNotPositiveInteger(value) → {Boolean}
Validates if a value is a positive integer.
Parameters:
Name | Type | Description |
---|---|---|
value | Number | Value to validate. |
- Source
Returns:
- Type:
- Boolean
Type Definitions
Achievement
Type:
Properties- Object
Name | Type | Attributes | Description |
---|---|---|---|
name | String | The name of the achievement. | |
description | String | The description of the achievement. | |
thumbnail | String | | <optional> | The thumbnail of the achievement. |
reward | Number | The reward of the achievement. | |
type | AchievementType | The type of the achievement. | |
progress | Array.<Number> | The progress of the achievement. |
- Source
AchievementData
Type:
- Source
AchievementStatus
Type:
Properties- Object
Name | Type | Description |
---|---|---|
Locked | Number | The achievement is locked. |
Unlocked | Number | The achievement is unlocked. |
- Source
AchievementType
Type:
Properties- Object
Name | Type | Description |
---|---|---|
Progressive | Number | The achievement is progressive (example: x messages sended). |
OneTime | Number | The achievement is one time only (example: first message). |
- Source
DXPlusErrorCodes
Type:
Properties- Object
Name | Type | Description |
---|---|---|
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. |
- Source
DatabaseData
Type:
Properties- Object
Name | Type | Description |
---|---|---|
guildId | Discord. | The id of the guild. |
ranks | Array.<Rank> | The ranks of the guild. |
achievements | Array.<Achievement> | The achievements of the guild. |
users | Array.<UserEntry> | The users of the guild. |
- Source
GuildData
Type:
- Source
LeaderboardOptions
Type:
Properties- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
guildId | Discord. | <optional> | 'global' | The id of the guild. |
limit | Number | <optional> | 10 | The limit of the leaderboard. |
- Source
LevelManagerEvents
Type:
Properties- Object
Name | Type | Description |
---|---|---|
ManagerReady | String | The manager is ready. |
XpAdded | String | The user has added xp. |
LevelUp | String | The user has leveled up. |
LevelDown | String | The user has leveled down. |
DegradeLevel | String | The user has degraded level. |
RankUp | String | The user has ranked up. |
RankDown | String | The user has ranked down. |
DegradeRank | String | The user has degraded rank. |
- Source
LevelManagerOptions
Type:
Properties- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
mongoUri | String | The uri of the mongo database. | ||
ranks | Array.<Rank> | | <optional> | The general ranks that will be used in every guild (default in Options class). | |
achievements | Array.<Achievement> | | <optional> | The general achievements that will be used in every guild (default in Options class). | |
maxXpToLevelUp | Number | | <optional> | 2500 | The max xp to level up (only works for the first level then it will be calculated with calculateXpToLevelUp function). |
saveInterval | Number | | <optional> | 1000 * 60 * 60 * 3 | The interval to save the data in the database (in milliseconds). |
autoSave | Boolean | | <optional> | true | If the data will be saved automatically. |
eventsPath | String | | <optional> | The path to the events folder. |
- Source
Rank
Type:
Properties- Object
Name | Type | Description |
---|---|---|
nameplate | String | The nameplate of the rank. |
color | Discord. | The color accent of the rank. |
priority | Number | The priority of the rank. |
min | Number | The minimum level of the rank. |
max | Number | The maximum level of the rank. |
- Source
RankData
Type:
- Source
UserEntry
Type:
Properties- Object
Name | Type | Description |
---|---|---|
id | Discord. | The id of the user. |
xp | Number | The xp of the user. |
level | Number | The level of the user. |
maxXpToLevelUp | Number | The max xp to level up. |
rank | Rank | The rank of the user. |
achievements | Array.<Achievement> | The achievements of the user. |
- Source