@@ -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 ( / .m p 3 / 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) {
10321032function 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) {
10761076function 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 ( ) ;
0 commit comments