Skip to content
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

Change method name to retrieve reactions from a channel message, and update support arguments #224

Open
joelzwarrington opened this issue Jun 2, 2023 · 3 comments

Comments

@joelzwarrington
Copy link

  1. Discordrb::API::Channel.get_reactions, should be changed to #reactions to match other methods and ruby syntax.
  2. before is not a supported argument1
  3. after should be optional, instead of being a required argument right now

def get_reactions(token, channel_id, message_id, emoji, before_id, after_id, limit = 100)

Footnotes

  1. https://discord.com/developers/docs/resources/channel#get-reactions

@Daniel-Worrall
Copy link
Member

The api methods are 1:1 mappings on the API methods which is why it is named that way. Any renaming would also be a breaking change.

I also don't wish to see an alias for this, though this can be monkey-patched in any app that wishes to use this this way.

@joelzwarrington
Copy link
Author

I think that the 1:1 mappings are inconsistent, as I've seen something like .message or .messages which is not a 1:1 mapping.

In my opinion, when building a Ruby client, you should try to use the same vocabulary/syntax that Ruby developers would expect. Of course this is only an opinion, but this is what I suggest to make it easier to understand and more 'ruby' like.

@Daniel-Worrall
Copy link
Member

In the case of .message and .messages, these are legacy code and I'd be in favour of adding aliases to bring them more in line with the 1:1 mapping

https://github.com/shardlab/discordrb/blame/47bf48abea68164611321c9acbc6b24025daddad/lib/discordrb/api/channel.rb#L45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants