Added reload stations option in maintenance command

This commit is contained in:
Christer Warén 2021-09-06 19:43:14 +03:00
parent f9ce2bfaf9
commit 8316723a6a

View File

@ -41,6 +41,12 @@ module.exports = {
description: "",
value: "6"
},
{
emoji: "<:RadioXList:688541155519889482>",
label: "Reload Stations",
description: "",
value: "7"
},
{
emoji: "<:dnd:746069698139127831>",
label: "Enable Maintenance Mode",
@ -108,6 +114,18 @@ module.exports = {
require(`../commands.js`).execute(client);
client.user.setStatus('online');
break;
case "7":
try {
client.funcs.logger('Stations', 'Started fetching list ' + client.config.stationslistUrl);
client.stations = await fetch(client.config.stationslistUrl)
.then(client.funcs.checkFetchStatus)
.then(response => response.json());
client.funcs.logger('Stations', 'Successfully fetched list');
} catch (error) {
client.funcs.logger('Stations', 'Fetching list failed');
}
break;
case "8":
client.user.setStatus('dnd');
break;