Added nickname checking when bot lacks a nickname

This commit is contained in:
Dev 2024-09-15 19:14:34 +01:00
parent 75e3514c09
commit e53cff5737

View File

@ -18,6 +18,12 @@ export class MatchBotDetailsCacheService {
* @param botToCache Bot details to cache
*/
public cacheBot(botToCache: IBotBase): void {
if (!botToCache.Info.Nickname) {
this.logger.warning(
`Unable to cache: ${botToCache.Info.Settings.Role} bot with id: ${botToCache._id} as it lacks a nickname`,
);
return;
}
this.botDetailsCache[`${botToCache.Info.Nickname.trim()}${botToCache.Info.Side}`] = botToCache;
}