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

Misleading parameter name in type of message#channel handler (MessageEventIndex in ClientEvents) also part#channel is wrong #113

Open
zeronumbers opened this issue May 2, 2024 · 0 comments

Comments

@zeronumbers
Copy link

zeronumbers commented May 2, 2024

https://github.com/matrix-org/node-irc/blob/master/src/events.ts#L62

  [key: MessageEventIndex]: (nick: MessageNick, who: string, message: Message) => void,

I believe who parameter should be named text since it actually holds string that nick sends.
https://node-irc.readthedocs.io/en/latest/API.html#'message#channel'

Shows that it should be text.

the actual code uses text as well:
https://github.com/matrix-org/node-irc/blob/master/src/irc.ts#L885

 ('message' + to) as MessageEventIndex, from, msgText, message);

the part#message is also wrong:

[key: PartEventIndex]: (nick: MessageNick, who: string, message: Message) => void,

who is actually reason

https://node-irc.readthedocs.io/en/latest/API.html#'part#channel'

@zeronumbers zeronumbers changed the title Misleading parameter name in type of message#channel handler (MessageEventIndex in ClientEvents) Misleading parameter name in type of message#channel handler (MessageEventIndex in ClientEvents) also part#channel is wrong May 2, 2024
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

1 participant