public async Task <RuntimeResult> CreateAutoroleAsync(IRole discordRole) { var create = await _autoroles.CreateAutoroleAsync(discordRole); if (!create.IsSuccess) { return(create.ToRuntimeResult()); } return(RuntimeCommandResult.FromSuccess("Autorole configuration created.")); }
public async Task CreateAutoroleAsync(IRole discordRole) { var create = await _autoroles.CreateAutoroleAsync(discordRole); if (!create.IsSuccess) { await _feedback.SendErrorAsync(this.Context, create.ErrorReason); } await _feedback.SendConfirmationAsync(this.Context, "Autorole configuration created."); }
public async Task <Result <FeedbackMessage> > CreateAutoroleAsync(IRole discordRole) { var create = await _autoroles.CreateAutoroleAsync ( _context.GuildID.Value, discordRole.ID, this.CancellationToken ); return(!create.IsSuccess ? Result <FeedbackMessage> .FromError(create) : new FeedbackMessage("Autorole configuration created.", _feedback.Theme.Secondary)); }