public ActionResult Interaction([FromForm] SlackInteractionDto slackInteraction) { var interaction = slackInteraction.ToInteraction(); if (interaction.Action == "buy") { _shopService.Buy(interaction); return(Ok()); } if (interaction.Action == "inventory") { return(Ok(InventoryInteractions(interaction))); } return(Ok()); }
public async Task <ActionResult> Interaction([FromForm] SlackInteractionDto slackInteraction) { var interaction = slackInteraction.ToInteraction(); var action = interaction.GetAction(); switch (action) { case Actions.Buy: await _shopMenuService.Buy(interaction); break; case Actions.Inventory: await InventoryInteractions(interaction); break; case Actions.Attribution: await _statsMenuService.AttributeStatPoint(interaction); break; case Actions.InventorySwitch: await _inventoryMenuService.ShowInventory(interaction); break; case Actions.EquipmentSwitch: await _inventoryMenuService.ShowEquipment(interaction); break; case Actions.Equipment: await EquipmentInteractions(interaction); break; case Actions.Give: await _inventoryMenuService.Give(interaction); break; case Actions.Target: await _inventoryMenuService.Target(interaction); break; case Actions.ShopSwitch: await _shopMenuService.ShopSwitch(interaction); break; case Actions.Attack: await _monsterMenuservice.Attack(interaction); break; default: throw new ArgumentOutOfRangeException(); } return(Ok()); }