client  chat with OpenAI API  ✔ should return a reply from chat completion message  ✔ should register messages to memory  ✔ should include conversation history for existing players  ✔ should use custom model when provided in options  ✔ should use custom instructions when provided in options  ✔ should wrap OpenAI.APIError and rethrow as a regular Error  conversation  manage messages  ✔ should start with an empty messages list  ✔ should have default limit 20 when not specified  ✔ should add a message to the conversation  ✔ should add multiple messages in order  manage messages with limit  ✔ should have the specified limit  ✔ should keep messages when under the limit  ✔ should remove oldest message when exceeding limit  ✔ should continue removing oldest messages as new ones are added  memory  manage player conversations  ✔ should have default 20 historySize when not specified  ✔ should return true when checking for an existing player  ✔ should return false when checking for an inexisting player  ✔ should retrieve conversation for an existing player  ✔ should initialize a new conversation for a new player on retrieve  ✔ should log when initializing conversation for an existing player  ✔ should register multiple messages in a conversation  manage player conversations with size limit  ✔ should have the specified historySize  ✔ should pass size to new conversations  ✔ should pass size to conversations created via retrieve  ✔ should enforce size limit when registering messages  ✔ should enforce size limit per player independently  message  retrieve properties  ✔ should get role  ✔ should get content  different roles  ✔ should support user role  ✔ should support assistant role  ✔ should support developer role  mineflayer-chatgpt  chatgpt  ✔ should add setConfig function  ✔ should add sendMessage function  ✔ should set config when setConfig is called with opts  ✔ should set config when setConfig is called without opts  ✔ should call client chat when sendMessage is called without error  ✔ should log error message when it is a generic error  ✔ should log error message when OpenAI error is rethrown by client  ✔ should log reply when enableLogging is true  ✔ should not log reply when enableLogging is false  moderator - sanitiseProfanity  ✔ should return clean text when input contains no profanity  ✔ should replace built-in profanity with asterisks  ✔ should replace custom profanity with asterisks  ✔ should handle multiple profane words  ✔ should return empty string when input is empty  ✔ should handle text with mixed case profanity   46 passing (35ms)