Class: Botiasloop::Commands::New

Inherits:
Base
  • Object
show all
Defined in:
lib/botiasloop/commands/new.rb

Overview

New command - creates a new conversation

Instance Method Summary collapse

Methods inherited from Base

command, description, inherited

Instance Method Details

#execute(context, _args = nil) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/botiasloop/commands/new.rb', line 12

def execute(context, _args = nil)
  new_conversation = context.chat.create_new_conversation
  context.conversation = new_conversation

  "**New conversation started (ID: #{new_conversation.uuid}).**\n" \
  "Use `/switch #{new_conversation.uuid}` to return later."
end