public async Task <Result <FeedbackMessage> > TransferRoleplayOwnershipAsync ( IUser newOwner, [RequireEntityOwner] [AutocompleteProvider("roleplay::owned")] Roleplay roleplay ) { var transferResult = await _discordRoleplays.TransferRoleplayOwnershipAsync(newOwner.ID, roleplay); return(!transferResult.IsSuccess ? Result <FeedbackMessage> .FromError(transferResult) : new FeedbackMessage("Roleplay ownership transferred.", _feedback.Theme.Secondary)); }
public async Task <RuntimeResult> TransferRoleplayOwnershipAsync ( IGuildUser newOwner, [RequireEntityOwnerOrPermission(typeof(TransferRoleplay), PermissionTarget.Other)] Roleplay roleplay ) { var transferResult = await _discordRoleplays.TransferRoleplayOwnershipAsync ( newOwner, roleplay ); if (!transferResult.IsSuccess) { return(transferResult.ToRuntimeResult()); } return(RuntimeCommandResult.FromSuccess("Roleplay ownership transferred.")); }
public async Task TransferRoleplayOwnershipAsync ( IGuildUser newOwner, [RequireEntityOwnerOrPermission(typeof(TransferRoleplay), PermissionTarget.Other)] Roleplay roleplay ) { var transferResult = await _discordRoleplays.TransferRoleplayOwnershipAsync ( newOwner, roleplay ); if (!transferResult.IsSuccess) { await _feedback.SendErrorAsync(this.Context, transferResult.ErrorReason); return; } await _feedback.SendConfirmationAsync(this.Context, "Roleplay ownership transferred."); }