mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Suppor string game updates and better setStatus logic
This commit is contained in:
@@ -28,13 +28,13 @@ exports.toDec = function (data) {
|
||||
var hextest = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i;
|
||||
|
||||
var num;
|
||||
|
||||
|
||||
if(!data)
|
||||
return 0;
|
||||
|
||||
if (hextest.test(data)) {
|
||||
// it's a hex number with a # in front
|
||||
|
||||
|
||||
// there's a bug in discord as of 28/10/15, where any
|
||||
// hex colors beginning with a 0 do not render properly.
|
||||
// this is a temporary fix, and it does mean that you won't
|
||||
@@ -44,7 +44,7 @@ exports.toDec = function (data) {
|
||||
tdata[1] = 1;
|
||||
data = tdata.join("");
|
||||
}
|
||||
|
||||
|
||||
num = parseInt(data.substr(1), 16).toString(10);
|
||||
} else if (hextest.test("#" + data)) {
|
||||
// it's a hex number with no # in front
|
||||
@@ -57,14 +57,14 @@ exports.toDec = function (data) {
|
||||
} else {
|
||||
num = data.toString(10);
|
||||
}
|
||||
|
||||
|
||||
return parseInt(num);
|
||||
}
|
||||
|
||||
exports.toHex = function (data) {
|
||||
|
||||
var text = data.toString(16);
|
||||
|
||||
|
||||
while(text.length < 6){
|
||||
text = "0" + text;
|
||||
}
|
||||
|
||||
5687
ref/gameMap.js
5687
ref/gameMap.js
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user