Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/commands/Factorio/onlineplayers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ const OnlinePlayers: Command<Message> = {

const serversWithScenario = rcon.rconConnections
.filter((connection) => connection.hasScenario)
.filter((connection) => connection.server.hidden === false)
.map((connection) => connection.server.discordname);
const serversWithoutScenario = rcon.rconConnections
.filter((connection) => !connection.hasScenario)
.filter((connection) => connection.server.hidden === false)
.map((connection) => connection.server.discordname);

const scenarioOutputProm = serversWithScenario.map((discordname) =>
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/serverHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ class serverHandler {
}
async discordHandler(data) {
if (data.server.dev) return; // ignore dev server
if (data.server.hidden) return; // return if server is hidden
const message = data.line.replace(
"${serverName}",
`<#${data.server.discordid}>`
Expand All @@ -546,7 +547,6 @@ class serverHandler {
modchannel.isText() &&
modchannel.send({
embed: new MessageEmbed(embed),
content: `<@&${config.moderatorroleid}>`,
});
}
async startHandler(data: OutputData) {
Expand Down
1 change: 1 addition & 0 deletions src/servers.example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const servers: FactorioServer[] = [
discord: false, // requires the full scenario, not just the mod
},
dev: false, // whether or not the server is developmental
hidden: false, // whether the server is hidden from ?po etc
},
];

Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface FactorioServer {
discord: boolean;
};
dev: boolean;
hidden: boolean
}

export type BotConfigEmojis = Record<string, string>;
Expand Down