This commit is contained in:
YasinOnm08 2024-10-03 13:32:27 +02:00
parent 82fe1285bf
commit 9373fa8e59

View file

@ -6,7 +6,7 @@ type ChatMessage = {
let chatHistory: ChatMessage[] = [];
function addMessageHistory(name: string, message: any): void {
function addMessageToHistory(name: string, message: any): void {
const newMessage: ChatMessage = {
name: name,
messages: message,
@ -16,7 +16,7 @@ function addMessageHistory(name: string, message: any): void {
console.log(`Added message from ${name}: ${message}`);
}
function removeMessageHistory(timestamp: number): void {
function removeMessageFromHistory(timestamp: number): void {
const index = chatHistory.findIndex((msg) => msg.timestamp === timestamp);
if (index > -1) {
chatHistory.splice(index, 1);