-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fixing setPresence method #69
Conversation
nyxx/lib/src/Shard.dart
Outdated
'type' : game.type, | ||
if(game.type == ActivityType.streaming) 'url' : game.url | ||
'type' : game.type._value, | ||
if(game.type._value == ActivityType.streaming._value) 'url' : game.url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove _value
and modify ==
operator in ActivityType
other is ActivityType && other._value == this._value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I also remove it for the moment in 'type' : game.type._value
? The only workaround I can think of that would leave it in a usable state would be to parse an int from the toString of game.type ultimately looking like:
'type' : int.parse(game.type.toString())
Although this would most likely be changed when getters are made for the enums if it's remembered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case not because we need int as in documentation. This is related to #70 that we need sometimes raw value of enum and now we don't have way to.
All "enums" should probably have something like |
Fixing setPresence method [ci skip]
Resolves both a serialization error to json & an issue regarding the packet format that discord expects for the presence.