private void raid_delete_impl(Context ctx, int id) { //Get a handle to the raid var handle = RaidManager.GetRaidFromID(id).Value; //Grab the data from the raid var data = RaidManager.GetRaidData(handle); //Check that it's valid Precondition.Assert(data.HasValue, "There was an error processing the raid."); //Get the owner var owner_id = data.Value.owner_id; //Check that the user is the owner Precondition.Assert(ctx.message.Author.Id == owner_id, "You are not the owner of the raid!"); //Delete the raid RaidManager.DeleteRaid(handle); //Return success Bot.GetBotInstance() .SendSuccessMessage(ctx.message.Channel, "Success", $"Raid has been deleted."); }