turt2live / matrix-bot-sdk

TypeScript/JavaScript SDK for Matrix bots
MIT License
194 stars 68 forks source link

Confusing Appservice docs: "(the sender_localpart)" #291

Open jaller94 opened 1 year ago

jaller94 commented 1 year ago

Three functions in src/appservice/Appservice.ts include "(the sender_localpart)" in their docs description. I don't know what this means and find it to be confusing, even after reading the function's code.

https://github.com/turt2live/matrix-bot-sdk/blob/5c7fbdf8f8cc9e5f4f00a6157e22fea5ceb7aad5/src/appservice/Appservice.ts#L346-L350

https://github.com/turt2live/matrix-bot-sdk/blob/5c7fbdf8f8cc9e5f4f00a6157e22fea5ceb7aad5/src/appservice/Appservice.ts#L354-L360

https://github.com/turt2live/matrix-bot-sdk/blob/5c7fbdf8f8cc9e5f4f00a6157e22fea5ceb7aad5/src/appservice/Appservice.ts#L339-L342

This last one got me wondering when reading the function description inside of a bot project using the lib. I felt like I needed to look up whether the function will return a user ID or local part.

jaller94 commented 1 year ago

Ahhhh, is this possibly to indicate that this function will always use the sender_localpart from the registration file, instead of any user_id override?

If this is the case, IMO it should say "based on the sender_localpart from the registration file" to be more clear.