-
Notifications
You must be signed in to change notification settings - Fork 796
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 Support of changing user status #258
Conversation
Because i'm made a stupid error ^^
@@ -320,6 +320,23 @@ func (s *Session) UserSettings() (st *Settings, err error) { | |||
return | |||
} | |||
|
|||
// UserUpdateStatus update the user status | |||
// status : The new status (Actual valid status are 'online','idle','dnd','invisible') | |||
func (s *Session) UserUpdateStatus(status string) (st *Settings, err error) { |
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.
Consider making a type and constants for the valid values, like VerificationLevel, so that we can restrict the values of status.
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.
The problem is actually you have 5 status.
"online","idle","dnd","invisible","offline".
However the Status can be set by the user as "online","idle","dnd" or "invisible"
And the library can see only Users as "online","idle","dnd" or "offline"
So even if there is a Status type the user can send a status bad type ("offline")
I will do that and make a verification in the function.
This is a try can be not usable.
Forget to change the data format
So Status is now a type. |
Status string `json:"status"` | ||
Game *Game `json:"game"` | ||
User *User `json:"user"` | ||
Status *Status `json:"status"` |
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.
Status Status json:"status"
GuildPositions []string `json:"guild_positions"` | ||
RestrictedGuilds []string `json:"restricted_guilds"` | ||
FriendSourceFlags *FriendSourceFlags `json:"friend_source_flags"` | ||
Status *Status `json:"status"` |
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.
Status instead of *Status
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.
Ok I will fix it
Add Support of changing user status
Recently Discord add the support to change the User status beetween Online, Idle, Do not Distrub and Invisible.
This PR is to implement that new functionality.