Skip to content

Commit 8ebfb0c

Browse files
authored
Merge pull request #133 from oof2win2/bugfix/general-fixes
General fixes
2 parents 22b3259 + dd28ca4 commit 8ebfb0c

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/base/GrafanaHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ class GrafanaHandler {
183183
* @param {*} server
184184
*/
185185
handleStatistics(statistics, server) {
186+
if (!statistics || typeof statistics !== "string") return
186187
const json = JSON.parse(statistics.split("\n")[0]);
187188
const otherStats = json[Object.keys(json)[0]].other;
188189

src/commands/Administration/getlogs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Rollback: Command<Message> = {
2222
if (!message.mentions.channels.first())
2323
return message.reply("No channel to get logs of provided!");
2424
args.shift(); // remove mention
25-
const lineCount = Math.min(Number(args.shift()) || 50, 50)
25+
const lineCount = Math.min(Number(args.shift()) || 50, 200)
2626
const server = serverJS.find(
2727
(server) => server.discordid === message.mentions.channels.first().id
2828
);

src/commands/Administration/resetserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const Resetserver: Command<Message> = {
101101
.map(
102102
(save) => `${client.config.serverpath}/${server.path}/saves/${save}`
103103
);
104-
const latestSavePath = saves[0];
104+
const latestSavePath = sortModifiedDate(saves)[0].path;
105105
// if there are saves, back up latest and remove all after
106106
if (latestSavePath) {
107107
const latestSave = latestSavePath.slice(

src/commands/Administration/rollback.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ const Rollback: Command<Message> = {
5858
};
5959
});
6060

61-
createPagedEmbed(content, message, null, embed);
61+
createPagedEmbed(content, message, undefined, embed);
6262
} else {
6363
// specific save provided
64-
let save;
64+
let save: fs.Stats;
6565
try {
6666
save = fs.statSync(
6767
`${client.config.serverpath}/${server.path}/saves/${args[1]}.zip`
@@ -73,7 +73,7 @@ const Rollback: Command<Message> = {
7373
message,
7474
`Are you sure you want to reset the save to \`${
7575
args[1]
76-
}\` from ${new Date(save.mtime).toISOString()}?`
76+
}\` from <t:${Math.round(save.mtime.valueOf() / 1000)}>?`
7777
);
7878
if (!confirm) return message.channel.send("Rollback cancelled");
7979

0 commit comments

Comments
 (0)