From 211ccda63c48e1cca49d6fba6ac29fa840dd57e2 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Thu, 18 May 2023 08:45:25 -0600 Subject: [PATCH] Add support for specifying the bot engine --- schema/Config.schema.json | 4 ++++ src/Game.ts | 3 +++ src/config.ts | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/schema/Config.schema.json b/schema/Config.schema.json index 1872ecb0..192ddb06 100644 --- a/schema/Config.schema.json +++ b/schema/Config.schema.json @@ -9,6 +9,10 @@ "type": "string", "description": "API key for the bot." }, + "engine": { + "type": "string", + "description": "Engine specifier of the bot, this is a plain text description of the bot's engine and network that will be recorded along with all games played." + }, "verbosity": { "type": "number", "description": "Enable verbose logging.", diff --git a/src/Game.ts b/src/Game.ts index 7d0dce3a..67bef75a 100644 --- a/src/Game.ts +++ b/src/Game.ts @@ -558,6 +558,9 @@ export class Game extends EventEmitter { if (config.greeting?.en) { this.sendChat(config.greeting); } + if (config.engine) { + this.sendChat({ en: `Engine: ${config.engine}`, engine: config.engine }); + } } const doing_handicap = diff --git a/src/config.ts b/src/config.ts index 94f46767..ccc0eba0 100644 --- a/src/config.ts +++ b/src/config.ts @@ -17,6 +17,11 @@ export interface Config { /** API key for the bot. */ apikey: string; + /** Engine specifier of the bot, this is a plain text description of the + * bot's engine and network that will be recorded along with all games + * played. */ + engine?: string; + /** Enable verbose logging. * @values 0-2 * @default 0 @@ -532,6 +537,7 @@ function load_config_or_throw(): Config { ) .alias("disable-status-updates", "q") .describe("apikey", "API key for the bot") + .describe("engine", "Version of the bot engine being used") .describe("v", "Increase level (use multiple times for more logs)") .count("v") .strict() @@ -548,6 +554,7 @@ function load_config_or_throw(): Config { apikey: args.apikey, verbosity: args.v || undefined, disable_status_updates: args.q || false, + engine: args.engine, }; let cli_bot_command = args._.length > 0 ? args._ : undefined;