File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,12 @@ const PlayerCountCommand: Command = {
2727 uptimeStr = formatDuration ( totalSeconds ) ;
2828 }
2929
30- if ( ! uptimeStr ) {
31- await interaction . reply ( "The server is currently down." ) ;
32- return ;
30+ let message = `There are currently ${ data . playerCount } players online on 6b6t.` ;
31+ if ( uptimeStr ) {
32+ message += ` The server has been up for ${ uptimeStr } .` ;
3333 }
3434
35- await interaction . reply (
36- `There are currently ${ data . playerCount } players online on 6b6t. The server has been up for ${ uptimeStr } .` ,
37- ) ;
35+ await interaction . reply ( message ) ;
3836 } ,
3937} ;
4038
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ async function fetchPlayersFromCommandService(): Promise<ServerData | null> {
190190 {
191191 headers : {
192192 Accept : "application/json" ,
193- Authorization : `${ process . env . HTTP_PROXY_COMMAND_SERVICE_ACCESS_TOKEN } ` ,
193+ Authorization : `Bearer ${ process . env . HTTP_PROXY_COMMAND_SERVICE_ACCESS_TOKEN } ` ,
194194 } ,
195195 } ,
196196 ) ;
@@ -258,9 +258,9 @@ export async function getServerData(): Promise<ServerData | null> {
258258
259259 const uptime : UptimeData | undefined = uptimeRes ?. statistics
260260 ? {
261- serverStartUnix : uptimeRes . statistics . serverStartUnix ,
262- currentUptimeHours : uptimeRes . statistics . currentUptimeHours ,
263- }
261+ serverStartUnix : uptimeRes . statistics . serverStartUnix ,
262+ currentUptimeHours : uptimeRes . statistics . currentUptimeHours ,
263+ }
264264 : undefined ;
265265
266266 return { ...players , version : version ?. version , uptime } ;
You can’t perform that action at this time.
0 commit comments