diff --git a/src/bot/utils/conversations.ts b/src/bot/utils/conversations.ts index abb8a8b..7be3e0e 100644 --- a/src/bot/utils/conversations.ts +++ b/src/bot/utils/conversations.ts @@ -83,7 +83,6 @@ export async function addMessagesToConversation(conversation: Conversation, mess }, last_update: Date.now(), }; - console.log(updatedConversation); await update("conversations", conversation.id, updatedConversation); } export async function newConversation(messages: ConversationMessage[], userId: string, modelName: string) { diff --git a/src/bot/utils/premium.ts b/src/bot/utils/premium.ts index 790adbe..3ea00be 100644 --- a/src/bot/utils/premium.ts +++ b/src/bot/utils/premium.ts @@ -225,7 +225,7 @@ export async function chargePlan(cost: number, environment: Environment, type: " plan: { used: environment.user.plan.used + cost, total: environment.user.plan.total, - history: environment.user.plan.history, + history: environment.user.plan.history ?? [], expenses: [ ...environment.user.plan.expenses ?? [], { @@ -245,7 +245,7 @@ export async function chargePlan(cost: number, environment: Environment, type: " plan: { used: environment.guild.plan.used + cost, total: environment.guild.plan.total, - history: environment.guild.plan.history, + history: environment.guild.plan.history ?? [], expenses: [ ...environment.guild.plan.expenses ?? [], {