Split SetStatus into SetStatus and SetGame
This commit is contained in:
@@ -639,12 +639,7 @@ 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)
|
|
||||||
throw new ArgumentNullException("Either status or gameId must be non-null");
|
|
||||||
|
|
||||||
if (status != null)
|
|
||||||
{
|
{
|
||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
@@ -655,11 +650,11 @@ namespace Discord
|
|||||||
default:
|
default:
|
||||||
throw new ArgumentException($"Invalid status, must be {UserStatus.Online} or {UserStatus.Away}");
|
throw new ArgumentException($"Invalid status, must be {UserStatus.Online} or {UserStatus.Away}");
|
||||||
}
|
}
|
||||||
|
return SendStatus();
|
||||||
}
|
}
|
||||||
|
public Task SetGame(int? gameId)
|
||||||
if (gameId != null)
|
{
|
||||||
_gameId = gameId;
|
_gameId = gameId;
|
||||||
|
|
||||||
return SendStatus();
|
return SendStatus();
|
||||||
}
|
}
|
||||||
private Task SendStatus()
|
private Task SendStatus()
|
||||||
|
|||||||
Reference in New Issue
Block a user