Skip to content

Commit 01ef647

Browse files
update
1 parent f45f7ab commit 01ef647

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

index_deployable.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ client.on("message", async message => {
166166
/* Fisher–Yates Shuffle Algorithm */
167167
var n = server.queue.length;
168168
var que_index = 1; /* currentSong playing is always at [0] -> [currentSong, 1, 2, 3, ..., n] */
169-
for (let i = n-1; i > que_index; i--) {
169+
for (var i = n-1; i > que_index; i--) {
170170
/* random index */
171171
let r = rand(que_index,i);
172172
/* swap */
@@ -469,7 +469,7 @@ async function queueLogic(message, search_string) {
469469
console.log(err);
470470
return;
471471
}
472-
for (let i = 0; i < files.length; i++) {
472+
for (var i = 0; i < files.length; i++) {
473473
/* push into queue if filetype matches '.mp3' format */
474474
if (files[i].match(/.mp3/gi))
475475
server.queue.push(files[i]);
@@ -525,7 +525,7 @@ async function queueLogic(message, search_string) {
525525
return message.channel.send('Something went wrong!\n\n' + error);
526526
}
527527
/* LOAD PLAYLIST VIDEOS */
528-
for (let i = 0; i < yt_playlist.length; i++) {
528+
for (var i = 0; i < yt_playlist.length; i++) {
529529
/* PRELOAD */
530530
try {
531531
var video = await youtube.getVideo(yt_playlist[i].url);
@@ -691,7 +691,7 @@ async function queueInfo(message, qNum = 10) {
691691
playString = server.queue[0].split('.mp3')[0];
692692
}
693693
/* queueString */
694-
for (let i = 1; i < server.queue.length; i++) {
694+
for (var i = 1; i < server.queue.length; i++) {
695695
if (qNum <= 15) {
696696
if (i <= qNum) {
697697
/* check link validity */
@@ -1004,7 +1004,7 @@ function create_genshin_table(message) {
10041004
}
10051005
if (objLength(array_Obj.users) > 0) {
10061006
/* this is inefficient if the # of users gets too large, would be nice to convert it into a database to filter duplicates. */
1007-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1007+
for (var i = 0; i < objLength(array_Obj.users); i++) {
10081008
/* this user table already exist. */
10091009
if (array_Obj.users[i].uid === message.author.id) {
10101010
/* check if this user has recently changed his/her userTag. */
@@ -1032,7 +1032,7 @@ function create_genshin_table(message) {
10321032
function showtable(message) {
10331033
var text = readTextFile('./json_data/genshin_wish_tables.json');
10341034
var array_Obj = JSON.parse(text);
1035-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1035+
for (var i = 0; i < objLength(array_Obj.users); i++) {
10361036
if (array_Obj.users[i].uid === message.author.id) {
10371037
message.channel.send(`${message.author}. Your Genshin Gacha Table is being fetched...`);
10381038
/* check if this user has recently changed his/her userTag. */
@@ -1076,7 +1076,7 @@ function showtable(message) {
10761076
function genshin_pity_calculation(message, pityType = 'normal') {
10771077
var text = readTextFile('./json_data/genshin_wish_tables.json');
10781078
var array_Obj = JSON.parse(text);
1079-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1079+
for (var i = 0; i < objLength(array_Obj.users); i++) {
10801080
if (array_Obj.users[i].uid === message.author.id) {
10811081
/* check if this user has recently changed his/her userTag. */
10821082
update_genshin_userTag(array_Obj, i);
@@ -1098,7 +1098,7 @@ function genshin_pity_calculation(message, pityType = 'normal') {
10981098
console.log('Hard Pity Calculation:')
10991099
console.log(hard_pity_table);
11001100
console.log('\n');
1101-
message.channel.send(`${message.author}. Calculating your 5* 'normal' pity point...`);
1101+
message.channel.send(`${message.author}. Calculating your 5* 'NORMAL' pity...`);
11021102
return message.channel.send({embed: {
11031103
author: {
11041104
name: message.member.user.tag,
@@ -1134,7 +1134,7 @@ function genshin_pity_calculation(message, pityType = 'normal') {
11341134
console.log('Soft Pity Calculation:')
11351135
console.log(soft_pity_table);
11361136
console.log('\n');
1137-
message.channel.send(`${message.author}. Calculating your 5* 'soft' pity point...`);
1137+
message.channel.send(`${message.author}. Calculating your 5* 'SOFT' pity...`);
11381138
return message.channel.send({embed: {
11391139
author: {
11401140
name: message.member.user.tag,
@@ -1198,7 +1198,7 @@ function wishCount(message, bannerType, commandType, nInc) {
11981198
var path = './json_data/genshin_wish_tables.json';
11991199
var text = readTextFile(path);
12001200
var array_Obj = JSON.parse(text);
1201-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1201+
for (var i = 0; i < objLength(array_Obj.users); i++) {
12021202
if (array_Obj.users[i].uid === message.author.id) {
12031203
/* check if this user has recently changed his/her userTag. */
12041204
update_genshin_userTag(array_Obj, i);
@@ -1303,7 +1303,7 @@ function wishReset(message, bannerType) {
13031303
var path = './json_data/genshin_wish_tables.json';
13041304
var text = readTextFile(path);
13051305
var array_Obj = JSON.parse(text);
1306-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1306+
for (var i = 0; i < objLength(array_Obj.users); i++) {
13071307
if (array_Obj.users[i].uid === message.author.id) {
13081308
/* check if this user has recently changed his/her userTag. */
13091309
update_genshin_userTag(array_Obj, i);
@@ -1517,11 +1517,11 @@ function sec_Convert(sec_string) {
15171517
var hours = Math.floor(minutes / 60);
15181518

15191519
/* re-factor minutes and seconds */
1520-
for (let i = 0; i < hours; i++) {
1520+
for (var i = 0; i < hours; i++) {
15211521
minutes -= 60;
15221522
seconds -= 3600;
15231523
}
1524-
for (let i = 0; i < minutes; i++) {
1524+
for (var i = 0; i < minutes; i++) {
15251525
seconds -= 60;
15261526
}
15271527

@@ -1547,7 +1547,7 @@ function music_loop_logic(message, cached_path, soundPath, audio_title) {
15471547
}
15481548
server.skip = false;
15491549
var count = 0;
1550-
for (let i = 0; i < server.skipAmount; i++) {
1550+
for (var i = 0; i < server.skipAmount; i++) {
15511551
if (server.queue.length > 0) {
15521552
server.queue.shift();
15531553
server.cached_video_info.shift();

index_native.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ client.on("message", async message => {
165165
/* Fisher–Yates Shuffle Algorithm */
166166
var n = server.queue.length;
167167
var que_index = 1; /* currentSong playing is always at [0] -> [currentSong, 1, 2, 3, ..., n] */
168-
for (let i = n-1; i > que_index; i--) {
168+
for (var i = n-1; i > que_index; i--) {
169169
/* random index */
170170
let r = rand(que_index,i);
171171
/* swap */
@@ -468,7 +468,7 @@ async function queueLogic(message, search_string) {
468468
console.log(err);
469469
return;
470470
}
471-
for (let i = 0; i < files.length; i++) {
471+
for (var i = 0; i < files.length; i++) {
472472
/* push into queue if filetype matches '.mp3' format */
473473
if (files[i].match(/.mp3/gi))
474474
server.queue.push(files[i]);
@@ -524,7 +524,7 @@ async function queueLogic(message, search_string) {
524524
return message.channel.send('Something went wrong!\n\n' + error);
525525
}
526526
/* LOAD PLAYLIST VIDEOS */
527-
for (let i = 0; i < yt_playlist.length; i++) {
527+
for (var i = 0; i < yt_playlist.length; i++) {
528528
/* PRELOAD */
529529
try {
530530
var video = await youtube.getVideo(yt_playlist[i].url);
@@ -690,7 +690,7 @@ async function queueInfo(message, qNum = 10) {
690690
playString = server.queue[0].split('.mp3')[0];
691691
}
692692
/* queueString */
693-
for (let i = 1; i < server.queue.length; i++) {
693+
for (var i = 1; i < server.queue.length; i++) {
694694
if (qNum <= 15) {
695695
if (i <= qNum) {
696696
/* check link validity */
@@ -1003,7 +1003,7 @@ function create_genshin_table(message) {
10031003
}
10041004
if (objLength(array_Obj.users) > 0) {
10051005
/* this is inefficient if the # of users gets too large, would be nice to convert it into a database to filter duplicates. */
1006-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1006+
for (var i = 0; i < objLength(array_Obj.users); i++) {
10071007
/* this user table already exist. */
10081008
if (array_Obj.users[i].uid === message.author.id) {
10091009
/* check if this user has recently changed his/her userTag. */
@@ -1031,7 +1031,7 @@ function create_genshin_table(message) {
10311031
function showtable(message) {
10321032
var text = readTextFile('./json_data/genshin_wish_tables.json');
10331033
var array_Obj = JSON.parse(text);
1034-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1034+
for (var i = 0; i < objLength(array_Obj.users); i++) {
10351035
if (array_Obj.users[i].uid === message.author.id) {
10361036
message.channel.send(`${message.author}. Your Genshin Gacha Table is being fetched...`);
10371037
/* check if this user has recently changed his/her userTag. */
@@ -1075,7 +1075,7 @@ function showtable(message) {
10751075
function genshin_pity_calculation(message, pityType = 'normal') {
10761076
var text = readTextFile('./json_data/genshin_wish_tables.json');
10771077
var array_Obj = JSON.parse(text);
1078-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1078+
for (var i = 0; i < objLength(array_Obj.users); i++) {
10791079
if (array_Obj.users[i].uid === message.author.id) {
10801080
/* check if this user has recently changed his/her userTag. */
10811081
update_genshin_userTag(array_Obj, i);
@@ -1097,7 +1097,7 @@ function genshin_pity_calculation(message, pityType = 'normal') {
10971097
console.log('Hard Pity Calculation:')
10981098
console.log(hard_pity_table);
10991099
console.log('\n');
1100-
message.channel.send(`${message.author}. Calculating your 5* 'normal' pity point...`);
1100+
message.channel.send(`${message.author}. Calculating your 5* 'NORMAL' pity...`);
11011101
return message.channel.send({embed: {
11021102
author: {
11031103
name: message.member.user.tag,
@@ -1133,7 +1133,7 @@ function genshin_pity_calculation(message, pityType = 'normal') {
11331133
console.log('Soft Pity Calculation:')
11341134
console.log(soft_pity_table);
11351135
console.log('\n');
1136-
message.channel.send(`${message.author}. Calculating your 5* 'soft' pity point...`);
1136+
message.channel.send(`${message.author}. Calculating your 5* 'SOFT' pity...`);
11371137
return message.channel.send({embed: {
11381138
author: {
11391139
name: message.member.user.tag,
@@ -1197,7 +1197,7 @@ function wishCount(message, bannerType, commandType, nInc) {
11971197
var path = './json_data/genshin_wish_tables.json';
11981198
var text = readTextFile(path);
11991199
var array_Obj = JSON.parse(text);
1200-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1200+
for (var i = 0; i < objLength(array_Obj.users); i++) {
12011201
if (array_Obj.users[i].uid === message.author.id) {
12021202
/* check if this user has recently changed his/her userTag. */
12031203
update_genshin_userTag(array_Obj, i);
@@ -1302,7 +1302,7 @@ function wishReset(message, bannerType) {
13021302
var path = './json_data/genshin_wish_tables.json';
13031303
var text = readTextFile(path);
13041304
var array_Obj = JSON.parse(text);
1305-
for (let i = 0; i < objLength(array_Obj.users); i++) {
1305+
for (var i = 0; i < objLength(array_Obj.users); i++) {
13061306
if (array_Obj.users[i].uid === message.author.id) {
13071307
/* check if this user has recently changed his/her userTag. */
13081308
update_genshin_userTag(array_Obj, i);
@@ -1516,11 +1516,11 @@ function sec_Convert(sec_string) {
15161516
var hours = Math.floor(minutes / 60);
15171517

15181518
/* re-factor minutes and seconds */
1519-
for (let i = 0; i < hours; i++) {
1519+
for (var i = 0; i < hours; i++) {
15201520
minutes -= 60;
15211521
seconds -= 3600;
15221522
}
1523-
for (let i = 0; i < minutes; i++) {
1523+
for (var i = 0; i < minutes; i++) {
15241524
seconds -= 60;
15251525
}
15261526

@@ -1546,7 +1546,7 @@ function music_loop_logic(message, cached_path, soundPath, audio_title) {
15461546
}
15471547
server.skip = false;
15481548
var count = 0;
1549-
for (let i = 0; i < server.skipAmount; i++) {
1549+
for (var i = 0; i < server.skipAmount; i++) {
15501550
if (server.queue.length > 0) {
15511551
server.queue.shift();
15521552
server.cached_video_info.shift();

0 commit comments

Comments
 (0)