Skip to content

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

@zeronumbers

Description

@zeronumbers

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions