New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline reaction #7
base: master
Are you sure you want to change the base?
Conversation
cad8cff
to
cfcd84e
Compare
|
||
public IUserMessage Message { get; private set; } | ||
|
||
readonly InteractiveService interactive; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property should be declared as private readonly InteractiveService _interactive;
, to best fit the C# style guidelines.
As well as for the property below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
public async Task<bool> HandleCallbackAsync(SocketReaction reaction) | ||
{ | ||
var reactionCallbackItem = data.Callbacks.FirstOrDefault(t => t.Reaction.Equals(reaction.Emote)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably best to use ==
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
doesn't work. Its not the same instance so we really have to use Equals
method.
{ | ||
public class InlineReactionCallback : IReactionCallback | ||
{ | ||
public RunMode RunMode => RunMode.Sync; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be RunMode.Async
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea to be honest, I used PaginatedMessageCallback
as a template.
@@ -6,8 +6,8 @@ | |||
</PropertyGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Discord.Net.Commands" Version="1.0.1" /> | |||
<PackageReference Include="Discord.Net.WebSocket" Version="1.0.1" /> | |||
<PackageReference Include="Discord.Net.Commands" Version="1.0.2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This update should be noted. Is this really necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is. The 1.0.1 version has some bug and result is following exception
System.InvalidOperationException: Unknown guild channel type
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs changes as explained in comments
Any chance of getting this updated merged? I think it's quite a useful feature. |
Added InlineReactionReply.
InlineReactionReply is normal UserMessage with a set of reactions and its own callbacks.
example story:
user triggers a command
bot responds with message e.g. "Do you want 1 or 2?" and adds reactions [1, 2]
user clicks on reaction 1 or 2
a callback is fired