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

Add missing tags for ClearChat and UserNotice #309

Merged
merged 3 commits into from Nov 9, 2021
Merged

Add missing tags for ClearChat and UserNotice #309

merged 3 commits into from Nov 9, 2021

Conversation

Romybron
Copy link
Contributor

@Romybron Romybron commented Nov 8, 2021

Type: Improvement
Fixes: #308

While rewriting my chat logger from tmi.js to Twurple, I noticed that some documented and undocumented tags were missing.

PS: This is my first GitHub contribution and PR and I hope I respected your dev style (some code I did not understand so I am leaving it as is)

packages/chat/src/ChatClient.ts Outdated Show resolved Hide resolved
packages/chat/src/ChatClient.ts Outdated Show resolved Hide resolved
packages/chat/src/ChatClient.ts Outdated Show resolved Hide resolved
}

get targetUserId(): string {
return this._tags.get('target-user-id')!;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't always set by Twitch (when clearing the whole chat, no user is targeted), so you shouldn't non-null-assert it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my thought while writing this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onTypedMessage is a public method, so messages can be accessed by anyone, and then it can definitely be null here.

@d-fischer d-fischer linked an issue Nov 8, 2021 that may be closed by this pull request
@Romybron
Copy link
Contributor Author

Romybron commented Nov 9, 2021

Thank you for the feedback I will rewrite it tomorrow 😃

@d-fischer d-fischer merged commit 621ba2c into twurple:main Nov 9, 2021
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

Successfully merging this pull request may close these issues.

Message id not included in UserNotice
2 participants