Split SetStatus into SetStatus and SetGame
This commit is contained in:
@@ -639,27 +639,22 @@ namespace Discord
|
|||||||
return _api.EditProfile(currentPassword: currentPassword, username: username, email: email ?? _currentUser?.Email, password: password,
|
return _api.EditProfile(currentPassword: currentPassword, username: username, email: email ?? _currentUser?.Email, password: password,
|
||||||
avatarType: avatarType, avatar: avatar);
|
avatarType: avatarType, avatar: avatar);
|
||||||
}
|
}
|
||||||
public Task SetStatus(string status = null, int? gameId = null)
|
public Task SetStatus(string status)
|
||||||
{
|
{
|
||||||
if (status == null && gameId == null)
|
switch (status)
|
||||||
throw new ArgumentNullException("Either status or gameId must be non-null");
|
|
||||||
|
|
||||||
if (status != null)
|
|
||||||
{
|
{
|
||||||
switch (status)
|
case UserStatus.Online:
|
||||||
{
|
case UserStatus.Away:
|
||||||
case UserStatus.Online:
|
_status = status;
|
||||||
case UserStatus.Away:
|
break;
|
||||||
_status = status;
|
default:
|
||||||
break;
|
throw new ArgumentException($"Invalid status, must be {UserStatus.Online} or {UserStatus.Away}");
|
||||||
default:
|
|
||||||
throw new ArgumentException($"Invalid status, must be {UserStatus.Online} or {UserStatus.Away}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return SendStatus();
|
||||||
if (gameId != null)
|
}
|
||||||
_gameId = gameId;
|
public Task SetGame(int? gameId)
|
||||||
|
{
|
||||||
|
_gameId = gameId;
|
||||||
return SendStatus();
|
return SendStatus();
|
||||||
}
|
}
|
||||||
private Task SendStatus()
|
private Task SendStatus()
|
||||||
|
|||||||
Reference in New Issue
Block a user