-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MessageAction backwards compatibility
- Loading branch information
Simon Oxtoby
committed
May 16, 2020
1 parent
557bb17
commit c006800
Showing
5 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Threading.Tasks; | ||
using SlackNet.Interaction; | ||
|
||
namespace SlackNet.AspNetCore | ||
{ | ||
class MessageActionAdapter : IMessageShortcutHandler | ||
{ | ||
private readonly IMessageActionHandler _actionHandler; | ||
public MessageActionAdapter(IMessageActionHandler actionHandler) => _actionHandler = actionHandler; | ||
|
||
public Task Handle(MessageShortcut request) => _actionHandler.Handle(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
using System.Threading.Tasks; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace SlackNet.Interaction | ||
{ | ||
public interface IMessageShortcutHandler | ||
{ | ||
Task Handle(MessageShortcut request); | ||
} | ||
|
||
[Obsolete("Use IMessageShortcutHandler instead")] | ||
public interface IMessageActionHandler | ||
{ | ||
Task Handle(MessageAction request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
using SlackNet.Events; | ||
using System; | ||
using SlackNet.Events; | ||
|
||
namespace SlackNet.Interaction | ||
{ | ||
[SlackType("message_action")] | ||
public class MessageShortcut : InteractionRequest | ||
[Obsolete("Use MessageShortcut instead")] | ||
public class MessageAction : InteractionRequest | ||
{ | ||
public string CallbackId { get; set; } | ||
public string TriggerId { get; set; } | ||
public MessageEvent Message { get; set; } | ||
} | ||
|
||
[SlackType("message_action")] | ||
public class MessageShortcut : MessageAction { } | ||
} |