Class: TelegramMeetupBot::Commands::CancelCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/telegram_meetup_bot/commands/cancel_command.rb

Instance Attribute Summary

Attributes inherited from Base

#message

Instance Method Summary collapse

Methods inherited from Base

#command, #initialize

Constructor Details

This class inherits a constructor from TelegramMeetupBot::Commands::Base

Instance Method Details

#execObject



4
5
6
7
8
9
10
11
# File 'lib/telegram_meetup_bot/commands/cancel_command.rb', line 4

def exec
  handle_date(date) do
    calendar = Calendar.new(date: date, user: author)
    deleted_user = calendar.delete_user_from_date
    args = deleted_user ? {} : {key: 'not_subscribed', date: date}
    build_response(args)
  end
end