Skip to content

Commit ba093b1

Browse files
committed
✨ Allow hidden servers
1 parent b949c88 commit ba093b1

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/commands/Factorio/onlineplayers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ const OnlinePlayers: Command<Message> = {
2323

2424
const serversWithScenario = rcon.rconConnections
2525
.filter((connection) => connection.hasScenario)
26+
.filter((connection) => connection.server.hidden === false)
2627
.map((connection) => connection.server.discordname);
2728
const serversWithoutScenario = rcon.rconConnections
2829
.filter((connection) => !connection.hasScenario)
30+
.filter((connection) => connection.server.hidden === false)
2931
.map((connection) => connection.server.discordname);
3032

3133
const scenarioOutputProm = serversWithScenario.map((discordname) =>

src/servers.example.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const servers: FactorioServer[] = [
1919
discord: false, // requires the full scenario, not just the mod
2020
},
2121
dev: false, // whether or not the server is developmental
22+
hidden: false, // whether the server is hidden from ?po etc
2223
},
2324
];
2425

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface FactorioServer {
1212
discord: boolean;
1313
};
1414
dev: boolean;
15+
hidden: boolean
1516
}
1617

1718
export type BotConfigEmojis = Record<string, string>;

0 commit comments

Comments
 (0)