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

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

Open
jaller94 opened this issue Dec 30, 2022 · 1 comment
Open

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

jaller94 opened this issue Dec 30, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@jaller94
Copy link
Contributor

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.

* Get the application service's "bot" Intent (the sender_localpart).
* @returns {Intent} The intent for the application service itself.
*/
public get botIntent(): Intent {
return this.getIntentForUserId(this.botUserId);

* Get the application service's "bot" MatrixClient (the sender_localpart).
* Normally the botIntent should be used to ensure that the bot user is safely
* handled.
* @returns {MatrixClient} The client for the application service itself.
*/
public get botClient(): MatrixClient {
return this.botIntent.underlyingClient;

* Get the application service's "bot" user ID (the sender_localpart).
*/
public get botUserId(): string {
return this.getUserId(this.registration.sender_localpart);

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 jaller94 added the enhancement New feature or request label Dec 30, 2022
@jaller94
Copy link
Contributor Author

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.

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

No branches or pull requests

1 participant